Skip to content

Commit

Permalink
guess_max in redcap_read()
Browse files Browse the repository at this point in the history
ref #245
  • Loading branch information
wibeasley committed Mar 12, 2019
1 parent 2c3c432 commit ef7ba30
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Description: Encapsulates functions to streamline calls from R to the REDCap
University. The Application Programming Interface (API) offers an avenue
to access and modify data programmatically, improving the capacity for
literate and reproducible programming.
Version: 0.9.10.9001
Date: 2019-01-09
Version: 0.9.10.9002
Date: 2019-03-12
Authors@R: c(person("Will", "Beasley", role = c("aut", "cre"), email =
"[email protected]", comment = c(ORCID = "0000-0002-5613-5006")),
person("David", "Bard", role = "ctb"),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ Version 0.10 (to be released)
* If no records are affected, a zero-length *character* vector is returned (instead of sometimes a zero-length *numeric* vector) (#212)
* New function (called `constants()`) easily exposes REDCap-specific constants. (#217)
* `id_position` allows user to specify if the record_id isn't in the first position (#207). However, we recommend that all REDCap projects keep this important variable first in the data dictionary.
* Link to new secure Zenodo DOI resolver (katrinleinweber #191)
* Link to new secure Zenodo DOI resolver (@katrinleinweber #191)
* parameters in `redcap_read()` and `redcap_read_oneshot()` are more consistent with the order in raw REDCap API. (#204)
* When the `verbose` parameter is NULL, then the value from getOption("verbose") is used. (#215)
* `guess_max` parameter provided in `redcap_read()` (no longer just `redcap_read_oneshot()`). Suggested by @isaactpetersen in #245.
* Documentation website constructed with pkgdown (#224).

### Modified Internals
Expand Down
4 changes: 4 additions & 0 deletions R/redcap-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#' @param filter_logic String of logic text (e.g., `[gender] = 'male'`) for filtering the data to be returned by this API method, in which the API will only return the records (or record-events, if a longitudinal project) where the logic evaluates as TRUE. An blank/empty string returns all records.
#'
#' @param guess_type A boolean value indicating if all columns should be returned as character. If true, [readr::read_csv()] guesses the intended data type for each column.
#' @param guess_max A positive integer passed to [readr::read_csv()] **per batch** that specifies the maximum number of records to use for guessing column types.
#' @param verbose A boolean value indicating if `message`s should be printed to the R console during the operation. The verbose output might contain sensitive information (*e.g.* PHI), so turn this off if the output might be visible somewhere public. Optional.
#' @param config_options A list of options to pass to `POST` method in the `httr` package. See the details in `redcap_read_oneshot()` Optional.
#' @param id_position The column position of the variable that unique identifies the subject. This defaults to the first variable in the dataset.
Expand Down Expand Up @@ -89,6 +90,7 @@ redcap_read <- function(
filter_logic = "",

guess_type = TRUE,
guess_max = 1000L,
verbose = TRUE,
config_options = NULL,
id_position = 1L
Expand All @@ -114,6 +116,7 @@ redcap_read <- function(
checkmate::assert_logical( export_data_access_groups , any.missing=F, len=1)
#
checkmate::assert_logical( guess_type , any.missing=F, len=1)
checkmate::assert_integerish(guess_max , any.missing=F, len=1, lower=1)
checkmate::assert_logical( verbose , any.missing=F, len=1, null.ok=T)
checkmate::assert_list( config_options , any.missing=T, len=1, null.ok=T)
checkmate::assert_integer( id_position , any.missing=F, len=1, lower=1L)
Expand Down Expand Up @@ -209,6 +212,7 @@ redcap_read <- function(
filter_logic = filter_logic,

guess_type = guess_type,
guess_max = guess_max,
verbose = verbose,
config_options = config_options
)
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.

0 comments on commit ef7ba30

Please sign in to comment.