diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..c913dbf --- /dev/null +++ b/NEWS.md @@ -0,0 +1,4 @@ +# ggsegChen 1.0.01 + +* adapted atlases to ggseg <= 1.6.0 +* Added a `NEWS.md` file to track changes to the package. diff --git a/README.Rmd b/README.Rmd index b2ee9d8..55b4129 100644 --- a/README.Rmd +++ b/README.Rmd @@ -10,7 +10,8 @@ knitr::opts_chunk$set( comment = "#>", fig.path = "man/figures/README-", fig.width = 6, - out.width = "100%" + out.width = "100%", + fig.retina = 3 ) devtools::load_all(".") ``` @@ -49,21 +50,18 @@ library(ggsegChen) ```{r} library(ggseg) -ggseg(atlas = chenAr, mapping = aes(fill = region)) + - scale_fill_brain("chenAr", package = "ggsegChen") + +plot(chenAr) + labs(title = "Chen areal (chenAr)") + theme(legend.position = "bottom", legend.text = element_text(size = 9)) + guides(fill = guide_legend(ncol = 3)) ``` ```{r fig.height = 6} -ggseg(atlas = chenTh, mapping = aes(fill = region)) + - scale_fill_brain("chenTh", package = "ggsegChen") + +plot(chenTh) + labs(title = "Chen thickness (chenTh)") + theme(legend.position = "bottom", legend.text = element_text(size = 9)) + guides(fill = guide_legend(ncol = 2)) - ``` diff --git a/README.md b/README.md index d5ca2fd..eb47d18 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,7 @@ library(ggsegChen) ``` r library(ggseg) -ggseg(atlas = chenAr, mapping = aes(fill = region)) + - scale_fill_brain("chenAr", package = "ggsegChen") + +plot(chenAr) + labs(title = "Chen areal (chenAr)") + theme(legend.position = "bottom", legend.text = element_text(size = 9)) + @@ -57,8 +56,7 @@ ggseg(atlas = chenAr, mapping = aes(fill = region)) + ``` r -ggseg(atlas = chenTh, mapping = aes(fill = region)) + - scale_fill_brain("chenTh", package = "ggsegChen") + +plot(chenTh) + labs(title = "Chen thickness (chenTh)") + theme(legend.position = "bottom", legend.text = element_text(size = 9)) + diff --git a/data-raw/chen.R b/data-raw/chen.R index 841dc3f..868b08e 100755 --- a/data-raw/chen.R +++ b/data-raw/chen.R @@ -34,6 +34,8 @@ chenTh <- chenTh %>% long - diff, long)) chenTh <- as_ggseg_atlas(chenTh) +chenTh <- as_brain_atlas(chenTh) +chenTh$palette <- brain_pals$chenTh usethis::use_data(chenTh, internal = FALSE, overwrite = TRUE, compress = "xz") @@ -71,6 +73,8 @@ chenAr <- chenAr %>% long - diff, long)) chenAr <- as_ggseg_atlas(chenAr) +chenAr <- as_brain_atlas(chenAr) +chenAr$palette <- brain_pals$chenAr usethis::use_data(chenAr, internal = FALSE, overwrite = TRUE, compress = "xz") diff --git a/data/chenAr.rda b/data/chenAr.rda index b60ea4e..bc9fa60 100755 Binary files a/data/chenAr.rda and b/data/chenAr.rda differ diff --git a/data/chenTh.rda b/data/chenTh.rda index e41a025..2023053 100755 Binary files a/data/chenTh.rda and b/data/chenTh.rda differ diff --git a/man/figures/README-unnamed-chunk-3-1.png b/man/figures/README-unnamed-chunk-3-1.png index b301d13..a5bd265 100644 Binary files a/man/figures/README-unnamed-chunk-3-1.png and b/man/figures/README-unnamed-chunk-3-1.png differ diff --git a/man/figures/README-unnamed-chunk-4-1.png b/man/figures/README-unnamed-chunk-4-1.png index 21d3189..1c5ee38 100644 Binary files a/man/figures/README-unnamed-chunk-4-1.png and b/man/figures/README-unnamed-chunk-4-1.png differ diff --git a/tests/testthat/test-chenAr.R b/tests/testthat/test-chenAr.R index 12cfc7d..cb68453 100755 --- a/tests/testthat/test-chenAr.R +++ b/tests/testthat/test-chenAr.R @@ -1,23 +1,18 @@ # ggseg ---- -context("test-chenAr-adapt_scales") -test_that("Check that ggseg:::adapt_scales is working", { - expect_equal(mode(ggseg:::adapt_scales(unnest(chenAr, ggseg))), "list") -}) - context("test-chenAr-palettes") test_that("check new palettes work", { expect_equal(length(brain_pal("chenAr", package = "ggsegChen")), 12) expect_error(brain_pal("chenAr"), "not a valid") - expect_true(all(names(brain_pal("chenAr", package = "ggsegChen")) %in% chenAr$region)) + expect_true(all(names(brain_pal("chenAr", package = "ggsegChen")) %in% brain_regions(chenAr))) }) context("test-chenAr-ggseg-atlas") test_that("atlases are true ggseg atlases", { - expect_true(is_ggseg_atlas(chenAr)) - + expect_true(is_brain_atlas(chenAr)) + expect_true(is_ggseg_atlas(as_ggseg_atlas(chenAr))) }) context("test-chenAr-ggseg") diff --git a/tests/testthat/test-chenTh.R b/tests/testthat/test-chenTh.R index d2c7fc2..e8e1dc1 100755 --- a/tests/testthat/test-chenTh.R +++ b/tests/testthat/test-chenTh.R @@ -1,8 +1,4 @@ # ggseg ---- -context("test-chenTh-adapt_scales") -test_that("Check that ggseg:::adapt_scales is working", { - expect_equal(mode(ggseg:::adapt_scales(unnest(chenTh, ggseg))), "list") -}) context("test-chenTh-palettes") test_that("check new palettes work", { @@ -10,13 +6,13 @@ test_that("check new palettes work", { expect_error(brain_pal("chenTh"), "not a valid") - expect_true(all(names(brain_pal("chenTh", package = "ggsegChen")) %in% chenTh$region)) + expect_true(all(names(brain_pal("chenTh", package = "ggsegChen")) %in% brain_regions(chenTh))) }) context("test-chenTh-ggseg-atlas") test_that("atlases are true ggseg atlases", { - - expect_true(is_ggseg_atlas(chenTh)) + expect_true(is_brain_atlas(chenTh)) + expect_true(is_ggseg_atlas(as_ggseg_atlas(chenTh))) })