diff --git a/R/meta_validate.R b/R/meta_validate.R index dc35140..6b137f7 100644 --- a/R/meta_validate.R +++ b/R/meta_validate.R @@ -90,12 +90,12 @@ meta_validate <- function(meta) { # check group factor level are the same u_plan <- unique(meta$plan[, c("population", "observation")]) - for(i in 1:nrow(u_plan)){ + for (i in 1:nrow(u_plan)) { key_pop <- u_plan[i, "population"] key_obs <- u_plan[i, "observation"] level_pop <- levels(meta$data_population[[metalite::collect_adam_mapping(meta, key_pop)$group]]) level_obs <- levels(meta$data_observation[[metalite::collect_adam_mapping(meta, key_obs)$group]]) - if(! all(level_pop == level_obs)){ + if (!all(level_pop == level_obs)) { stop("Inconsistent group level: the levels of group variable from population and observation datasets are not the same") } } diff --git a/tests/testthat/test-meta_validate.R b/tests/testthat/test-meta_validate.R index 3b67a51..a4b351a 100644 --- a/tests/testthat/test-meta_validate.R +++ b/tests/testthat/test-meta_validate.R @@ -1,4 +1,3 @@ - test_that("Check data_type", { meta <- meta_example() meta$data_population <- NULL