From 2153e4ddef2d8f4b906a83230a56b80af6194ba0 Mon Sep 17 00:00:00 2001 From: Sharla Gelfand Date: Tue, 11 May 2021 11:10:44 -0400 Subject: [PATCH] Tests and r cmd check fixes --- .Rbuildignore | 1 + NAMESPACE | 2 ++ R/datamations-package.R | 2 ++ tests/testthat/test-prep_specs_summarize.R | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 R/datamations-package.R diff --git a/.Rbuildignore b/.Rbuildignore index f4f931e4..ef201faa 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,4 @@ start-up.R ^app\.R$ ^rsconnect$ ^sandbox$ +azure-pipelines.yml diff --git a/NAMESPACE b/NAMESPACE index 42e4695a..20ba40f9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -59,6 +59,8 @@ importFrom(purrr,map_if) importFrom(purrr,pmap_dbl) importFrom(purrr,pmap_dfr) importFrom(purrr,reduce) +importFrom(rlang,":=") +importFrom(rlang,.data) importFrom(rlang,parse_expr) importFrom(stats,median) importFrom(tibble,as_tibble) diff --git a/R/datamations-package.R b/R/datamations-package.R new file mode 100644 index 00000000..306992a0 --- /dev/null +++ b/R/datamations-package.R @@ -0,0 +1,2 @@ +#' @importFrom rlang .data := +NULL diff --git a/tests/testthat/test-prep_specs_summarize.R b/tests/testthat/test-prep_specs_summarize.R index 274b5517..b1573a0b 100644 --- a/tests/testthat/test-prep_specs_summarize.R +++ b/tests/testthat/test-prep_specs_summarize.R @@ -66,7 +66,7 @@ test_that("prep_specs_summarize returns a list with two elements - one for the j expect_length(specs, 2) # Returns a list with two elements expect_meta_parse_value(specs[1], "jitter") # First element meta.parse is jitter expect_meta_parse_value(specs[2], NULL) # Second element meta is empty - expect_meta_axes(specs, TRUE) # Axes are set to TRUE to be shown + expect_meta_axes(specs, FALSE) # Additional axes are NOT shown when there's no groups expect_data_values(specs[[1]], palmerpenguins::penguins %>% dplyr::mutate(x = 1, gemini_id = dplyr::row_number()) %>% dplyr::select(gemini_id, y = bill_length_mm, x)) # One data value for each row in the input data frame, containing grouping variables - x value depending on the grouping - x = 1 if n_groups != 3