diff --git a/DESCRIPTION b/DESCRIPTION index b88a32a..cd8d0e2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,7 +29,7 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Depends: R (>= 3.5) Imports: admiral, diff --git a/NEWS.md b/NEWS.md index 7b3541e..e76de7a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,12 @@ +# admiralophtha 1.1.0 + +## Updates to Functions + +- The following function arguments of `derive_var_afeye()` are entering the next phase of the deprecation process (#223): + + * The argument `dataset_occ` + * The argument `lat_vals` + # admiralophtha 1.0.0 ## Updates to Templates diff --git a/R/derive_var_afeye.R b/R/derive_var_afeye.R index 3b627a0..2253b0a 100644 --- a/R/derive_var_afeye.R +++ b/R/derive_var_afeye.R @@ -63,34 +63,30 @@ derive_var_afeye <- function(dataset, dataset_occ, loc_var, lat_var, lat_vals, loc_vals = "EYE") { # BEGIN DEPRECATION if (!missing(lat_vals)) { - deprecate_warn( - "1.0.0", + deprecate_stop( + "1.1.0", "derive_var_afeye(lat_vals = )", details = "Please ensure your laterality values are from the set `c('LEFT', 'RIGHT', 'BILATERAL')`" ) - } else { - lat_vals <- c("LEFT", "RIGHT", "BILATERAL") } if (!missing(dataset_occ)) { - deprecate_warn( - "1.0.0", + deprecate_stop( + "1.1.0", "derive_var_afeye(dataset_occ = )", "derive_var_afeye(dataset = )" ) - dataset <- dataset_occ } # END DEPRECATION seye_vals <- c("LEFT", "RIGHT", "BILATERAL") + lat_vals <- c("LEFT", "RIGHT", "BILATERAL") loc_var <- assert_symbol(enexpr(loc_var)) lat_var <- assert_symbol(enexpr(lat_var)) - assert_character_vector(loc_vals) - assert_character_vector(seye_vals) assert_character_vector(lat_vals) assert_data_frame(dataset, required_vars = expr_c( diff --git a/tests/testthat/test-derive_var_afeye.R b/tests/testthat/test-derive_var_afeye.R index 5cbb18a..5c0c65b 100644 --- a/tests/testthat/test-derive_var_afeye.R +++ b/tests/testthat/test-derive_var_afeye.R @@ -68,7 +68,7 @@ test_that("derive_var_afeye Test 3: Deprecation of dataset_occ", { "XXX001", "P01", "RIGHT", "", "", NA_character_, ) - expect_warning( + expect_error( actual_output3 <- expected_output3 %>% select(-AFEYE) %>% derive_var_afeye( @@ -77,13 +77,7 @@ test_that("derive_var_afeye Test 3: Deprecation of dataset_occ", { loc_var = AELOC, lat_var = AELAT ), - class = "lifecycle_warning_deprecated" - ) - - expect_dfs_equal( - actual_output3, - expected_output3, - keys = c("STUDYID", "USUBJID", "AELOC", "AELAT") + class = "lifecycle_error_deprecated" ) }) @@ -96,7 +90,7 @@ test_that("derive_var_afeye Test 4: Deprecation of lat_vals", { "XXX001", "P01", "RIGHT", "", "", NA_character_, ) - expect_warning( + expect_error( actual_output4 <- expected_output4 %>% select(-AFEYE) %>% derive_var_afeye( @@ -104,12 +98,6 @@ test_that("derive_var_afeye Test 4: Deprecation of lat_vals", { lat_var = AELAT, lat_vals = c("LEFT", "RIGHT", "BILATERAL") ), - class = "lifecycle_warning_deprecated" - ) - - expect_dfs_equal( - actual_output4, - expected_output4, - keys = c("STUDYID", "USUBJID", "AELOC", "AELAT") + class = "lifecycle_error_deprecated" ) })