Skip to content

Commit

Permalink
tidy parameters
Browse files Browse the repository at this point in the history
ref #204
  • Loading branch information
wibeasley committed May 27, 2018
1 parent 4c585f3 commit 3a48b1b
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 38 deletions.
13 changes: 5 additions & 8 deletions R/redcap-read-oneshot-eav.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,13 @@
redcap_read_oneshot_eav <- function(
redcap_uri,
token,
records = NULL,
records_collapsed = "",
fields = NULL,
fields_collapsed = "",
events = NULL,
events_collapsed = "",
records = NULL, records_collapsed = "",
fields = NULL, fields_collapsed = "",
events = NULL, events_collapsed = "",
export_data_access_groups = FALSE,
filter_logic = "",
raw_or_label = 'raw',
raw_or_label_headers = 'raw',
raw_or_label = "raw",
raw_or_label_headers = "raw",
verbose = TRUE,
config_options = NULL
) {
Expand Down
23 changes: 13 additions & 10 deletions R/redcap-read-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,20 @@
#' }

redcap_read_oneshot <- function(
redcap_uri, token, records=NULL, records_collapsed="",
fields=NULL, fields_collapsed="",
events=NULL, events_collapsed="",
export_survey_fields = FALSE,
export_data_access_groups=FALSE,
filter_logic="",
raw_or_label='raw',
raw_or_label_headers='raw',
redcap_uri,
token,
records = NULL, records_collapsed = "",
fields = NULL, fields_collapsed = "",
events = NULL, events_collapsed = "",
export_survey_fields = FALSE,
export_data_access_groups = FALSE,
filter_logi = "",
raw_or_labe = "raw",
raw_or_label_headers = "raw",
guess_type = TRUE,
guess_max = 1000L,
verbose=TRUE, config_options=NULL
verbose = TRUE,
config_options = NULL
) {
#TODO: NULL verbose parameter pulls from getOption("verbose")

Expand All @@ -96,7 +99,7 @@ redcap_read_oneshot <- function(
if( !(raw_or_label_headers %in% c("raw", "label")) )
stop("The optional parameter `raw_or_label_headers` must be either 'raw' or 'label'.")

token <- sanitize_token(token)
token <- sanitize_token(token)
validate_field_names(fields)

if( all(nchar(records_collapsed)==0) )
Expand Down
26 changes: 16 additions & 10 deletions R/redcap-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,23 @@
#'

redcap_read <- function(
batch_size=100L, interbatch_delay=0.5, continue_on_error=FALSE,
redcap_uri, token, records=NULL, records_collapsed="",
fields=NULL, fields_collapsed="",
events=NULL, events_collapsed="",
export_survey_fields = FALSE,
export_data_access_groups=FALSE,
filter_logic="",
raw_or_label='raw',
raw_or_label_headers='raw',
batch_size = 100L,
interbatch_delay = 0.5,
continue_on_error = FALSE,
redcap_uri,
token,
records = NULL, records_collapsed = "",
fields = NULL, fields_collapsed = "",
events = NULL, events_collapsed = "",
export_survey_fields = FALSE,
export_data_access_groups = FALSE,
filter_logic = "",
raw_or_label = "raw",
raw_or_label_headers = "raw",
guess_type = TRUE,
verbose=TRUE, config_options=NULL, id_position=1L
verbose = TRUE,
config_options = NULL,
id_position = 1L
) {

checkmate::assert_character(redcap_uri, any.missing=F, len=1, pattern="^.{1,}$")
Expand Down
6 changes: 4 additions & 2 deletions man/redcap_read.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions man/redcap_read_oneshot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/redcap_read_oneshot_eav.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3a48b1b

Please sign in to comment.