From 4abede5d0d4d7cd4243592d45db3f68491aa4082 Mon Sep 17 00:00:00 2001 From: Richard Hanna Date: Thu, 15 Sep 2022 15:32:21 -0400 Subject: [PATCH] Increment to version 0.1.0 --- R/bind_tables.R | 2 +- R/checks.R | 2 +- R/utils.R | 2 +- cran-comments.md | 2 +- docs/index.html | 5 ++-- docs/pkgdown.yml | 2 +- docs/reference/add_partial_keys.html | 4 +-- docs/reference/clean_redcap.html | 4 +-- docs/reference/clean_redcap_long.html | 7 ++--- docs/reference/index.html | 22 +++++++--------- docs/reference/link_arms.html | 4 +-- docs/reference/read_redcap_tidy.html | 38 +++++++++++++-------------- docs/sitemap.xml | 3 --- man/bind_tables.Rd | 2 +- man/check_repeat_and_nonrepeat.Rd | 2 +- vignettes/longitudinal_redcap.Rmd | 2 +- 16 files changed, 48 insertions(+), 55 deletions(-) diff --git a/R/bind_tables.R b/R/bind_tables.R index 473c3eac..dc72dccf 100644 --- a/R/bind_tables.R +++ b/R/bind_tables.R @@ -10,7 +10,7 @@ #' modifying an environment. #' #' @param .data A tibble generated by \code{read_redcap_tidy()}. Required. -#' @param environment The environment to add the tibles to. Default is +#' @param environment The environment to add the tibbles to. Default is #' \code{global_env()}). #' @param tbls A vector of \code{form_name}s. Default behavior is all tibbles. #' @param structure Specify REDCap structure to load into environment, either diff --git a/R/checks.R b/R/checks.R index 7e2eb20f..10f77d73 100644 --- a/R/checks.R +++ b/R/checks.R @@ -53,7 +53,7 @@ check_user_rights <- function( #' #' @return #' A helpful error message alerting the user to existence of a form containing -#' both repeating and non-repeating strucutre. +#' both repeating and non-repeating structure. #' #' @param db_data The REDCap database output generated by #' \code{REDCapR::redcap_read_oneshot()$data} diff --git a/R/utils.R b/R/utils.R index b0005719..15d0a419 100644 --- a/R/utils.R +++ b/R/utils.R @@ -350,7 +350,7 @@ multi_choice_to_labels <- function(db_data, db_metadata) { # Check for empty selection strings indicating missing data or incorrect # data field attribute types in REDCap if (is.na(db_metadata$select_choices_or_calculations[i])) { - warning(paste0("The field ", {field_name}, " in ", + warning(paste0("The field ", field_name, " in ", db_metadata$form_name[i], " is a ", db_metadata$field_type[i], " field type, however it does not have any categories.")) diff --git a/cran-comments.md b/cran-comments.md index d8024e5a..66ce9006 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -7,7 +7,7 @@ Thank you for taking the time to review this submission and please reach out to ## R CMD check results: - 0 ERRORs or WARNINGs on any builds -- A NOTE is generated in R-hub Windows (Server 2022, R-devel 64-bit), but should be addressed by adding `lastMiKTeXException` to the `.Rbuildignore` +- A NOTE is generated in R-hub Windows (Server 2022, R-devel 64-bit), a similar issue appears to arise in the `REDCapR` package and appears to be related to the R-hub test environment. ``` * checking for detritus in the temp directory ... NOTE diff --git a/docs/index.html b/docs/index.html index e9812c27..312d58f5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -87,8 +87,7 @@ -

The {REDCapTidieR} package provides an elegant way to import data from a REDCap database into an R environment. It builds upon the {REDCapR} package to query the REDCap API and then transforms the returned data into a set of tidy tibbles.

-

{REDCapTidieR} is especially useful for dealing with complex databases that are longitudinal or include repeated instruments or both.

+

The {REDCapTidieR} package provides an elegant way to import data from a REDCap database into an R environment. It builds upon the {REDCapR} package to query the REDCap API and then transforms the returned data into a set of tidy tibbles. {REDCapTidieR} is especially useful for dealing with complex databases that are longitudinal or include repeated instruments or both.

Installation

@@ -101,7 +100,7 @@

Getting Started

Use read_redcap_tidy() together with bind_tables() to import data from all instruments into your environment.

-

Read vignette("getting-started") to learn more.

+

Read the Getting Started vignette to learn more.

Collaboration diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index df1d42d0..6b05a1dd 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: REDCapTidieR: REDCapTidieR.html longitudinal_redcap: longitudinal_redcap.html -last_built: 2022-09-13T15:01Z +last_built: 2022-09-15T19:19Z urls: reference: https://chop-cgtdataops.github.io/REDCapTidieR/reference article: https://chop-cgtdataops.github.io/REDCapTidieR/articles diff --git a/docs/reference/add_partial_keys.html b/docs/reference/add_partial_keys.html index 1bf1f44b..49a69dbe 100644 --- a/docs/reference/add_partial_keys.html +++ b/docs/reference/add_partial_keys.html @@ -1,5 +1,5 @@ -Add Partial Keys for Helper Variables — add_partial_keys • REDCapTidieRAdd partial key helper variables to dataframes — add_partial_keys • REDCapTidieRExtract non-Longitudinal REDCap Databases into Tidy Tibbles — clean_redcap • REDCapTidieRExtract non-longitudinal REDCap databases into tidy tibbles — clean_redcap • REDCapTidieRExtract Longitudinal REDCap Databases into Tidy Tibbles — clean_redcap_long • REDCapTidieRExtract longitudinal REDCap databases into tidy tibbles — clean_redcap_long • REDCapTidieRLink Longitudinal REDCap Forms with the Events/Arms They Belong To — link_arms • REDCapTidieRLink longitudinal REDCap forms with their events/arms — link_arms • REDCapTidieRExtract REDCap Databases to Tidy Tibbles — read_redcap_tidy • REDCapTidieRExtract a REDCap database into a tidy supertibble — read_redcap_tidy • REDCapTidieR @@ -59,18 +55,15 @@
-

Detect REDCap database outputs from REDCapR extracts for the -following database structure elements:

  • Repeat Instruments

  • -
  • Longitudinal Events

  • -
  • Longitudinal Arms

  • -

Return a tidy tibble to the user using the REDCapTidieR -opinionated framework.

+

Call the REDCap API to retrieve data and metadata about a project, +and then transform the output into a tidy "supertibble" that contains tidy +tibbles, where each tibble represents a single instrument.

@@ -86,8 +79,8 @@

Extract REDCap Databases to Tidy Tibbles

Arguments

redcap_uri

The -uri/url of the REDCap server typically formatted as -"https://server.org/apps/redcap/api/". Required.

+URI/URL of the REDCap server (e.g., +"https://server.org/apps/redcap/api/"). Required.

token
@@ -110,9 +103,16 @@

Arguments

Value

-

Returns a tibble with list elements containing tidy dataframes. Users -can access dataframes under the redcap_data column with reference to -form_name and structure column details.

+

Returns a tibble in which each row represents a REDCap instrument.

+
+
+

Details

+

This function uses REDCapR to call the REDCap API. The REDCap API returns +a "sparse matrix" that mashes data from all data collection instruments +together. In complex databases, such as those that contain repeated +instruments, this is unwieldy. The `read_redcap_tidy` function intelligently +deconvolutes the sparse matrix and splices the data into individual tibbles, +where one tibble represents the data from one instrument.

diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 0de6936b..43073f40 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -15,9 +15,6 @@ https://chop-cgtdataops.github.io/REDCapTidieR/articles/REDCapTidieR.html - - https://chop-cgtdataops.github.io/REDCapTidieR/articles/getting_started.html - https://chop-cgtdataops.github.io/REDCapTidieR/articles/index.html diff --git a/man/bind_tables.Rd b/man/bind_tables.Rd index f01e4171..34a8dc7b 100644 --- a/man/bind_tables.Rd +++ b/man/bind_tables.Rd @@ -9,7 +9,7 @@ bind_tables(.data, environment = global_env(), tbls = NULL, structure = NULL) \arguments{ \item{.data}{A tibble generated by \code{read_redcap_tidy()}. Required.} -\item{environment}{The environment to add the tibles to. Default is +\item{environment}{The environment to add the tibbles to. Default is \code{global_env()}).} \item{tbls}{A vector of \code{form_name}s. Default behavior is all tibbles.} diff --git a/man/check_repeat_and_nonrepeat.Rd b/man/check_repeat_and_nonrepeat.Rd index 6c8d0c95..baae26a8 100644 --- a/man/check_repeat_and_nonrepeat.Rd +++ b/man/check_repeat_and_nonrepeat.Rd @@ -12,7 +12,7 @@ check_repeat_and_nonrepeat(db_data) } \value{ A helpful error message alerting the user to existence of a form containing -both repeating and non-repeating strucutre. +both repeating and non-repeating structure. } \description{ Check for potential instruments that are given both repeating and diff --git a/vignettes/longitudinal_redcap.Rmd b/vignettes/longitudinal_redcap.Rmd index 81988f78..05177cce 100644 --- a/vignettes/longitudinal_redcap.Rmd +++ b/vignettes/longitudinal_redcap.Rmd @@ -72,4 +72,4 @@ The only really noticeable difference here is the inclusion of `redcap_repeat_in ### Single-Arm Longitudinal REDCap Databases -By default, longitudinal REDCap databases are automatically assigned arms. We have found that if the database does not make use of more than the single default arm the assignment of arms is redundant. Therefore, `redcap_arm` will only appear in data ouputs if more than one arm are detected in a database. +By default, longitudinal REDCap databases are automatically assigned arms. We have found that if the database does not make use of more than the single default arm the assignment of arms is redundant. Therefore, `redcap_arm` will only appear in data outputs if more than one arm are detected in a database.