Skip to content

Commit

Permalink
identical parameter description from httr & readr
Browse files Browse the repository at this point in the history
ref #425
  • Loading branch information
wibeasley committed Sep 2, 2022
1 parent 44c37de commit 86eeaf7
Show file tree
Hide file tree
Showing 49 changed files with 106 additions and 171 deletions.
4 changes: 2 additions & 2 deletions R/kernel-api.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#' typically formatted as "https://server.org/apps/redcap/api/".
#' Required.
#' @param post_body List of contents expected by the REDCap API. Required.
#' @param config_options A list of options to pass to `POST` method in the
#' `httr` package. See the details below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#' @param encoding The encoding value passed to [httr::content()]. Defaults
#' to 'UTF-8'.
#' @param content_type The MIME value passed to [httr::content()]. Defaults
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-arm-export.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#' 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 config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `has_arms`: a `logical` value indicating if the REDCap project has
Expand Down
6 changes: 3 additions & 3 deletions R/redcap-dag-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
#' [httr::content()]. Defaults to 'UTF-8'.
#' @param locale a [readr::locale()] object to specify preferences like
#' number, date, and time formats. This object is passed to
#' [`readr::read_csv()`]. Defaults to [readr::default_locale()].
#' [readr::read_csv()]. Defaults to [readr::default_locale()].
#' @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.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `data`: A [tibble::tibble()] of all data access groups of the project.
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-download-file-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#' Optional
#' @param verbose A boolean value indicating if `message`s should be printed
#' to the R console during the operation. Optional.
#' @param config_options A list of options to pass to [httr::POST()] method
#' in the 'httr' package. See the details below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements,
#' * `success`: A boolean value indicating if the operation was apparently
Expand Down
9 changes: 2 additions & 7 deletions R/redcap-event-instruments.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#' 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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements,
#' * `data`: A [tibble::tibble()] where each row represents one column
Expand All @@ -36,11 +36,6 @@
#' REDCap. If an operation is successful, the `raw_text` is returned as an
#' empty string to save RAM.
#'
#' @details
#' The full list of configuration options accepted by the `httr` package is
#' viewable by executing [httr::httr_options()]. The `httr` package and
#' documentation is available at https://cran.r-project.org/package=httr.
#'
#' @author Victor Castro, Will Beasley
#'
#' @references The official documentation can be found on the 'API Help Page'
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-instrument-download.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#' only for the specified event from that record. Optional.
#' @param verbose A boolean value indicating if `message`s should be printed
#' to the R console during the operation. Optional.
#' @param config_options A list of options to pass to [httr::POST()] method
#' in the 'httr' package. See the details below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements,
#' * `success`: A boolean value indicating if the operation was apparently
Expand Down
9 changes: 2 additions & 7 deletions R/redcap-instruments.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#' 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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements,
#' * `data`: A [tibble::tibble()] where each row represents one column
Expand All @@ -38,11 +38,6 @@
#' REDCap. If an operation is successful, the `raw_text` is returned as an
#' empty string to save RAM.
#'
#' @details
#' The full list of configuration options accepted by the `httr` package is
#' viewable by executing [httr::httr_options()]. The `httr` package and
#' documentation is available at https://cran.r-project.org/package=httr.
#'
#' @author Victor Castro, Will Beasley
#'
#' @references The official documentation can be found on the 'API Help Page'
Expand Down
6 changes: 3 additions & 3 deletions R/redcap-log-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
#' [httr::content()]. Defaults to 'UTF-8'.
#' @param locale a [readr::locale()] object to specify preferences like
#' number, date, and time formats. This object is passed to
#' [`readr::read_csv()`]. Defaults to [readr::default_locale()].
#' [readr::read_csv()]. Defaults to [readr::default_locale()].
#' @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.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `data`: An R [tibble::tibble()] of all data access groups of the project.
Expand Down
10 changes: 3 additions & 7 deletions R/redcap-metadata-coltypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#' [httr::content()]. Defaults to 'UTF-8'.
#' @param locale a [readr::locale()] object to specify preferences like
#' number, date, and time formats. This object is passed to
#' [`readr::read_csv()`]. Defaults to [readr::default_locale()].
#' [readr::read_csv()]. Defaults to [readr::default_locale()].
#' @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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return A [readr::cols()] object is returned, which can be
#' passed to [redcap_read()] or [redcap_read_oneshot()].
Expand Down Expand Up @@ -102,10 +102,6 @@
#' then (c) in a [dplyr::mutate()] statement,
#' use [readr::parse_integer()] to cast it to the desired type.
#'
#' The full list of configuration options accepted by the `httr` package is
#' viewable by executing [httr::httr_options()]. The `httr` package and
#' documentation is available at https://cran.r-project.org/package=httr.
#'
#' @author Will Beasley, Philip Chase
#'
#' @references The official documentation can be found on the 'API Help Page'
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-metadata-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#' 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 config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#'
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-metadata-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#' 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 [httr::POST()] method
#' in the 'httr' package. See the details in [redcap_read_oneshot()] Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `success`: A boolean value indicating if the operation was apparently
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-next-free-record-name.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#' 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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return a [base::character] vector of either
#' length 1 (if successful) or length 0 (if not successful).
Expand Down
6 changes: 3 additions & 3 deletions R/redcap-project-info-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
#' [httr::content()]. Defaults to 'UTF-8'.
#' @param locale a [readr::locale()] object to specify preferences like
#' number, date, and time formats. This object is passed to
#' [`readr::read_csv()`]. Defaults to [readr::default_locale()].
#' [readr::read_csv()]. Defaults to [readr::default_locale()].
#' @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.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `data`: An R [tibble::tibble()] of all data access groups of the project.
Expand Down
8 changes: 2 additions & 6 deletions R/redcap-read-oneshot-eav.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
#' 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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `data`: A [tibble::tibble()] of the desired records and columns.
Expand All @@ -89,10 +89,6 @@
#' empty string to save RAM.
#'
#' @details
#' The full list of configuration options accepted by the `httr` package is
#' viewable by executing [httr::httr_options()]. The `httr`
#' package and documentation is available at
#' https://cran.r-project.org/package=httr.
#'
#' If you do not pass in this export_data_access_groups value, it will
#' default to `FALSE`. The following is from the API help page for version
Expand Down
13 changes: 4 additions & 9 deletions R/redcap-read-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@
#' [httr::content()]. Defaults to 'UTF-8'.
#' @param locale a [readr::locale()] object to specify preferences like
#' number, date, and time formats. This object is passed to
#' [`readr::read_csv()`]. Defaults to [readr::default_locale()].
#' [readr::read_csv()]. Defaults to [readr::default_locale()].
#' @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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `data`: A [tibble::tibble()] of the desired records and columns.
Expand All @@ -105,11 +105,8 @@
#' empty string to save RAM.
#'
#' @details
#' The full list of configuration options accepted by the `httr` package is
#' viewable by executing [httr::httr_options()]. The `httr` package and
#' documentation is available at https://cran.r-project.org/package=httr.
#'
#' If you do not pass in this `export_data_access_groups` value, it will default
#' If you do not pass an `export_data_access_groups` value, it will default
#' to `FALSE`. The following is from the API help page for version 10.5.1:
#' *This flag is only viable if the user whose token is being used to make the
#' API request is **not** in a data access group. If the user is in a group,
Expand Down Expand Up @@ -148,7 +145,6 @@
#' fields = desired_fields_v1
#' )$data
#'
#'
#' # Specify the column types.
#' col_types <- readr::cols(
#' record_id = readr::col_integer(),
Expand All @@ -164,7 +160,6 @@
#' token = token,
#' col_types = col_types
#' )$data
#'
#' }

#' @importFrom magrittr %>%
Expand Down
6 changes: 3 additions & 3 deletions R/redcap-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@
#' [httr::content()]. Defaults to 'UTF-8'.
#' @param locale a [readr::locale()] object to specify preferences like
#' number, date, and time formats. This object is passed to
#' [`readr::read_csv()`]. Defaults to [readr::default_locale()].
#' [readr::read_csv()]. Defaults to [readr::default_locale()].
#' @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 config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#' @param id_position The column position of the variable that unique
#' identifies the subject (typically `record_id`).
#' This defaults to the first variable in the dataset.
Expand Down
9 changes: 2 additions & 7 deletions R/redcap-report.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#' 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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `data`: A [tibble::tibble()] of the desired records and columns.
Expand All @@ -52,11 +52,6 @@
#' REDCap. If an operation is successful, the `raw_text` is returned as an
#' empty string to save RAM.
#'
#' @details
#' The full list of configuration options accepted by the `httr` package is
#' viewable by executing [httr::httr_options()]. The `httr` package and
#' documentation is available at https://cran.r-project.org/package=httr.
#'
#' @author Will Beasley
#'
#' @references The official documentation can be found on the 'API Help Page'
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-survey-link-export-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#' Optional
#' @param verbose A boolean value indicating if `message`s should be printed
#' to the R console during the operation. Optional.
#' @param config_options A list of options to pass to [httr::POST()] method
#' in the 'httr' package. See the details below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements,
#' * `success`: A boolean value indicating if the operation was apparently
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-upload-file-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#' Optional
#' @param verbose A boolean value indicating if `message`s should be printed
#' to the R console during the operation. Optional.
#' @param config_options A list of options to pass to `POST` method in the
#' `httr` package. See the details below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `success`: A boolean value indicating if the operation was apparently
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-users-export.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#' 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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `data_user`: A [tibble::tibble()] of all users associated with the project.
Expand Down
7 changes: 2 additions & 5 deletions R/redcap-variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#' 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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements,
#' * `data`: A [tibble::tibble()] where each row represents one column
Expand All @@ -33,9 +33,6 @@
#' empty string to save RAM.
#'
#' @details
#' The full list of configuration options accepted by the `httr` package is
#' viewable by executing [httr::httr_options()]. The `httr` package and
#' documentation is available at https://cran.r-project.org/package=httr.
#'
#' As of REDCap version 6.14.2, three variable types are *not* returned in
#' this call: calculated, file, and descriptive. All variables returned are
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-version.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#' 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 below. Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return a [utils::packageDescription]
#'
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-write-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#' 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 [httr::POST()] method
#' in the 'httr' package. See the details in [redcap_read_oneshot()] Optional.
#' @param config_options A list of options passed to [httr::POST()].
#' See details at [httr::httr_options()]. Optional.
#'
#' @return Currently, a list is returned with the following elements:
#' * `success`: A boolean value indicating if the operation was apparently
Expand Down
Loading

0 comments on commit 86eeaf7

Please sign in to comment.