Skip to content

Commit

Permalink
autoimport
Browse files Browse the repository at this point in the history
  • Loading branch information
DanChaltiel committed Nov 26, 2024
1 parent ce3b745 commit 7e6bc43
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
11 changes: 10 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ importFrom(cli,format_inline)
importFrom(cli,qty)
importFrom(dplyr,"%>%")
importFrom(dplyr,across)
importFrom(dplyr,all_of)
importFrom(dplyr,any_of)
importFrom(dplyr,arrange)
importFrom(dplyr,case_match)
Expand Down Expand Up @@ -53,7 +52,17 @@ importFrom(dplyr,setdiff)
importFrom(dplyr,setequal)
importFrom(dplyr,summarise)
importFrom(dplyr,transmute)
importFrom(flextable,align)
importFrom(flextable,as_flextable)
importFrom(flextable,bg)
importFrom(flextable,bold)
importFrom(flextable,flextable)
importFrom(flextable,fontsize)
importFrom(flextable,hline_bottom)
importFrom(flextable,merge_h)
importFrom(flextable,padding)
importFrom(flextable,set_header_df)
importFrom(flextable,set_table_properties)
importFrom(forcats,as_factor)
importFrom(forcats,fct_infreq)
importFrom(forcats,fct_relevel)
Expand Down
1 change: 1 addition & 0 deletions R/ae_table_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' @inherit ae_table_soc seealso
#'
#' @return a crosstable
#' @importFrom cli cli_abort
#' @importFrom dplyr arrange case_match case_when cur_group filter left_join mutate rename_with select summarise
#' @importFrom forcats fct_relevel fct_reorder
#' @importFrom rlang check_dots_empty check_installed
Expand Down
7 changes: 4 additions & 3 deletions R/ae_table_soc.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#'
#' @seealso [ae_table_grade()], [ae_table_soc()], [ae_plot_grade()], [ae_plot_grade_sum()], [butterfly_plot()]
#'
#' @importFrom cli cli_warn
#' @importFrom cli cli_abort cli_warn
#' @importFrom dplyr across any_of arrange count cur_group filter if_else left_join mutate pull rename select summarise
#' @importFrom forcats fct_infreq
#' @importFrom glue glue
Expand Down Expand Up @@ -173,8 +173,9 @@ ae_table_soc = function(
#' @export
#'
#' @importFrom dplyr case_match lag lead transmute
#' @importFrom flextable align bg bold flextable fontsize hline_bottom merge_h padding set_header_df set_table_properties
#' @importFrom purrr map map_int
#' @importFrom rlang check_installed set_names
#' @importFrom rlang set_names
#' @importFrom stringr str_detect str_replace_all
#' @importFrom tibble as_tibble_col
#' @importFrom tidyr separate_wider_regex
Expand Down Expand Up @@ -264,7 +265,7 @@ as_flextable.ae_table_soc = function(x,
#' @return a crosstable (dataframe)
#' @export
#' @importFrom cli cli_abort cli_warn
#' @importFrom dplyr any_of arrange count filter left_join mutate select summarise
#' @importFrom dplyr across any_of arrange count filter left_join mutate n_distinct select summarise
#' @importFrom forcats fct_reorder
#' @importFrom ggplot2 aes facet_grid geom_blank geom_col ggplot labs scale_x_continuous theme unit vars
#' @importFrom glue glue
Expand Down
5 changes: 3 additions & 2 deletions R/assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ assert_names_exists = function(df, l){
}
}

#' @importFrom cli cli_abort
#' @importFrom purrr keep
#' @importFrom tibble lst
assert_not_null = function(...){
nulls = lst(...) %>% keep(is.null) %>% names()
if(length(nulls)>0){
Expand All @@ -63,8 +66,6 @@ assert_not_null = function(...){

#' @importFrom cli cli_abort cli_vec cli_warn format_inline
#' @importFrom dplyr pull
#' @importFrom rlang caller_arg check_dots_empty
#' @importFrom tibble tibble
grstat_data_warn = function (.data, message, subjid, max_subjid=5,
class="grstat_data_warn"){
if (missing(max_subjid))
Expand Down
2 changes: 1 addition & 1 deletion R/waterfall_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ waterfall_plot = function(data_recist, rc_sum="RCTLSUM", rc_resp="RCRESP", rc_da

#' @noRd
#' @keywords internal
#' @importFrom dplyr all_of filter n_distinct
#' @importFrom dplyr filter n_distinct
waterfall_check = function(df, subjid="SUBJID") {
assert_names_exists(df, subjid)
df %>%
Expand Down
2 changes: 2 additions & 0 deletions inst/IMPORTLIST
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
align = flextable
all_of = dplyr
attr = base
bold = flextable
dir_create = fs
intersect = dplyr
isFALSE = base
Expand Down
Binary file modified inst/autoimport_cache.rds
Binary file not shown.

0 comments on commit 7e6bc43

Please sign in to comment.