Skip to content

Commit b58ec2e

Browse files
committed
fix for check
1 parent 3b5d84e commit b58ec2e

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

NAMESPACE

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ importFrom(dplyr,mutate)
4444
importFrom(dplyr,n)
4545
importFrom(dplyr,n_distinct)
4646
importFrom(dplyr,na_if)
47+
importFrom(dplyr,pick)
4748
importFrom(dplyr,pull)
4849
importFrom(dplyr,rename)
4950
importFrom(dplyr,rename_with)
@@ -115,6 +116,7 @@ importFrom(rlang,arg_match)
115116
importFrom(rlang,caller_arg)
116117
importFrom(rlang,check_dots_empty)
117118
importFrom(rlang,check_installed)
119+
importFrom(rlang,current_env)
118120
importFrom(rlang,ensym)
119121
importFrom(rlang,int)
120122
importFrom(rlang,is_empty)

R/ae_table_soc.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#' @seealso [ae_table_grade()], [ae_table_soc()], [ae_plot_grade()], [ae_plot_grade_sum()], [butterfly_plot()]
2929
#'
3030
#' @importFrom cli cli_abort cli_warn
31-
#' @importFrom dplyr across any_of arrange count cur_group filter if_else left_join mutate pull rename select summarise
31+
#' @importFrom dplyr across any_of arrange count cur_group filter if_else left_join mutate pick pull rename select summarise
3232
#' @importFrom forcats fct_infreq
3333
#' @importFrom glue glue
3434
#' @importFrom purrr iwalk keep map

R/utils.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@ get_label = function(x, default=names(x)){
9393

9494
#' @noRd
9595
#' @keywords internal
96+
#' @importFrom rlang current_env
9697
apply_labels = function(data, ..., warn_missing=FALSE) {
9798
args = lst(...)
9899
unknowns = setdiff(names(args), names(data))
99100
if (length(unknowns) && warn_missing) {
100-
cli_warn("Cannot apply a label to unknown column{?s} in `data`: {.var {unknowns}}",
101+
cli_warn("Cannot find column{?s} in `data`: {.var {unknowns}}",
101102
class="crosstable_missing_label_warning",
102103
call=current_env())
103104
}

tests/testthat/test-data.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
test_that("Proportions of AE grades are respected", {
44
p_ae = c(0.4,0.3,0.2,0.1,0.01)
55
p_sae = c(0.15,0.15,0.3,0.3,0.1)
6-
tm = grstat_example(1000, ae_p_na=0, ae_p_sae=0.5, seed=42)
6+
tm = grstat_example(2000, ae_p_na=0, ae_p_sae=0.5, seed=42)
77
x = tm$ae %>% with(table(aegr, sae)) %>% prop.table(margin=2) %>% round(2)
8-
as.matrix(x)
8+
# as.matrix(x)/cbind(p_sae, p_ae)
99
expect_equal(unname(as.matrix(x)[,"Yes"]), p_sae, tolerance=0.05) # 5% tolerance
1010
expect_equal(unname(as.matrix(x)[,"No"]), p_ae, tolerance=0.05)
1111
})

0 commit comments

Comments
 (0)