Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement argument checking for exported functions #114

Merged
merged 14 commits into from
Dec 20, 2022
11 changes: 11 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ importFrom(REDCapR,redcap_event_instruments)
importFrom(REDCapR,redcap_instruments)
importFrom(REDCapR,redcap_metadata_read)
importFrom(REDCapR,redcap_read_oneshot)
importFrom(REDCapR,sanitize_token)
importFrom(checkmate,assert_character)
importFrom(checkmate,assert_data_frame)
importFrom(checkmate,check_character)
importFrom(checkmate,check_choice)
importFrom(checkmate,check_environment)
importFrom(checkmate,check_logical)
importFrom(checkmate,expect_character)
importFrom(checkmate,expect_double)
importFrom(checkmate,expect_factor)
importFrom(checkmate,expect_logical)
importFrom(cli,cli_abort)
importFrom(cli,cli_vec)
importFrom(cli,cli_warn)
importFrom(dplyr,"%>%")
importFrom(dplyr,across)
Expand All @@ -50,17 +56,22 @@ importFrom(purrr,compose)
importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map_int)
importFrom(purrr,map_lgl)
importFrom(purrr,pluck)
importFrom(rlang,"!!!")
importFrom(rlang,.data)
importFrom(rlang,as_closure)
importFrom(rlang,as_label)
importFrom(rlang,caller_arg)
importFrom(rlang,caller_env)
importFrom(rlang,check_installed)
importFrom(rlang,current_env)
importFrom(rlang,enquo)
importFrom(rlang,env_poke)
importFrom(rlang,global_env)
importFrom(rlang,is_atomic)
importFrom(rlang,is_bare_formula)
importFrom(rlang,is_bare_list)
importFrom(rlang,new_environment)
importFrom(stringi,stri_split_fixed)
importFrom(stringr,str_detect)
Expand Down
16 changes: 8 additions & 8 deletions R/bind_tibbles.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@
#' @importFrom purrr map2 pluck
#'
#' @examples
#' \dontrun{
#' # Create an empty environment
#' my_env <- new.env()
#'
#' ls(my_env)
#'
#' # Mock up a supertibble
#' supertbl <- tibble::tribble(
#' ~redcap_form_name, ~redcap_data, ~structure,
#' "super_hero_powers", list(), "repeating",
#' "heroes_information", list(), "nonrepeating"
#' )
#' superheroes_supertbl
#'
#' bind_tibbles(supertbl, my_env)
#' bind_tibbles(superheroes_supertbl, my_env)
#'
#' ls(my_env)
#'
#'}
#' @export

bind_tibbles <- function(supertbl,
environment = global_env(),
tbls = NULL) {
check_arg_is_supertbl(supertbl, req_cols = "redcap_data")
check_arg_is_env(environment)
check_arg_is_character(tbls, null.ok = TRUE, any.missing = FALSE, min.len = 1)

# Name variables
my_supertbl <- supertbl

Expand Down
Loading