Basic REDCapR Operations
-2024-11-21
+2024-12-08
Source:vignettes/BasicREDCapROperations.Rmd
BasicREDCapROperations.Rmd
Read all records and fields
# Return all records and all variables.
ds_all_rows_all_fields <- redcap_read(redcap_uri = uri, token = token)$data
-#> 24 variable metadata records were read from REDCap in 0.3 seconds. The http status code was 200.
+#> 24 variable metadata records were read from REDCap in 0.2 seconds. The http status code was 200.
#> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds. The http status code was 200.
#> 3 instrument metadata records were read from REDCap in 0.1 seconds. The http status code was 200.
#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-11-21 15:41:02.059732.
+#> Starting to read 5 records at 2024-12-08 16:36:08.825915.
#> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).
#> 5 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
ds_all_rows_all_fields # Inspect the returned dataset
@@ -150,7 +150,7 @@ Read a subset of the records#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 2 records at 2024-11-21 15:41:03.833573.
+#> Starting to read 2 records at 2024-12-08 16:36:10.756281.
#> Reading batch 1 of 1, with subjects 1 through 3 (ie, 2 unique subject records).
#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
# Return all records and all variables.
ds_all_rows_all_fields <- redcap_read(redcap_uri = uri, token = token)$data
-#> 24 variable metadata records were read from REDCap in 0.3 seconds. The http status code was 200.
+#> 24 variable metadata records were read from REDCap in 0.2 seconds. The http status code was 200.
#> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds. The http status code was 200.
#> 3 instrument metadata records were read from REDCap in 0.1 seconds. The http status code was 200.
#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-11-21 15:41:02.059732.
+#> Starting to read 5 records at 2024-12-08 16:36:08.825915.
#> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).
#> 5 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
ds_all_rows_all_fields # Inspect the returned dataset
@@ -150,7 +150,7 @@ Read a subset of the records#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 2 records at 2024-11-21 15:41:03.833573.
+#> Starting to read 2 records at 2024-12-08 16:36:10.756281.
#> Reading batch 1 of 1, with subjects 1 through 3 (ie, 2 unique subject records).
#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
Read a subset of the fields= token,
fields = desired_fields
)$data
-#> 24 variable metadata records were read from REDCap in 0.2 seconds. The http status code was 200.
+#> 24 variable metadata records were read from REDCap in 0.1 seconds. The http status code was 200.
#> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds. The http status code was 200.
#> 3 instrument metadata records were read from REDCap in 0.1 seconds. The http status code was 200.
-#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
+#> 1 rows were read from REDCap in 0.2 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-11-21 15:41:05.639084.
+#> Starting to read 5 records at 2024-12-08 16:36:12.560361.
#> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).
#> 5 records and 3 columns were read from REDCap in 0.2 seconds. The http status code was 200.
@@ -209,13 +209,13 @@ Re
token = token,
fields = desired_fields_v3
)$data
-#> 24 variable metadata records were read from REDCap in 0.2 seconds. The http status code was 200.
+#> 24 variable metadata records were read from REDCap in 0.1 seconds. The http status code was 200.
#> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds. The http status code was 200.
#> 3 instrument metadata records were read from REDCap in 0.1 seconds. The http status code was 200.
#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-11-21 15:41:07.233009.
+#> Starting to read 5 records at 2024-12-08 16:36:14.412496.
#> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).
#> 5 records and 3 columns were read from REDCap in 0.2 seconds. The http status code was 200.
@@ -252,7 +252,7 @@ Re
#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 2 records at 2024-11-21 15:41:08.848766.
+#> Starting to read 2 records at 2024-12-08 16:36:16.274297.
#> Reading batch 1 of 1, with subjects 3 through 5 (ie, 2 unique subject records).
#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
@@ -307,7 +307,7 @@ Additional Returned Information#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-11-21 15:41:10.574863.
+#> Starting to read 5 records at 2024-12-08 16:36:18.052757.
#> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).
#> 5 records and 3 columns were read from REDCap in 0.2 seconds. The http status code was 200.
all_information #Inspect the additional information
@@ -352,7 +352,7 @@ Additional Returned Information#> [1] NA
#>
#> $elapsed_seconds
-#> [1] 1.557914
+#> [1] 1.639954
@@ -366,20 +366,20 @@ Session Information#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.4.2 (2024-10-31)
-#> os macOS Sonoma 14.7
+#> os macOS Sonoma 14.7.1
#> system aarch64, darwin20
#> ui X11
#> language en
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz UTC
-#> date 2024-11-21
+#> date 2024-12-08
#> pandoc 3.1.11 @ /usr/local/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> backports 1.5.0 2024-05-23 [1] CRAN (R 4.4.0)
-#> bit 4.5.0 2024-09-20 [1] CRAN (R 4.4.1)
+#> bit 4.5.0.1 2024-12-03 [1] CRAN (R 4.4.1)
#> bit64 4.5.2 2024-09-22 [1] CRAN (R 4.4.1)
#> bslib 0.8.0 2024-07-29 [1] CRAN (R 4.4.0)
#> cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
@@ -413,7 +413,7 @@ Session Information#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0)
#> ragg 1.3.3 2024-09-11 [1] CRAN (R 4.4.1)
#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
-#> REDCapR * 1.3.0.9000 2024-11-21 [1] local
+#> REDCapR * 1.3.0.9000 2024-12-08 [1] local
#> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0)
#> rmarkdown 2.29 2024-11-04 [1] CRAN (R 4.4.1)
#> rstudioapi 0.17.1 2024-10-22 [1] CRAN (R 4.4.1)
@@ -424,7 +424,7 @@ Session Information#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.4.0)
#> svglite 2.1.3 2023-12-08 [1] CRAN (R 4.4.0)
#> systemfonts 1.1.0 2024-05-15 [1] CRAN (R 4.4.0)
-#> textshaping 0.4.0 2024-05-24 [1] CRAN (R 4.4.0)
+#> textshaping 0.4.1 2024-12-06 [1] CRAN (R 4.4.1)
#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
#> tidyselect 1.2.1 2024-03-11 [1] CRAN (R 4.4.0)
#> tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.4.0)
@@ -441,7 +441,7 @@ Session Information#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
-Report rendered by runner at 2024-11-21, 15:41 +0000 in 11
+
Report rendered by runner at 2024-12-08, 16:36 +0000 in 12
seconds.
Re
#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 2 records at 2024-11-21 15:41:08.848766.
+#> Starting to read 2 records at 2024-12-08 16:36:16.274297.
#> Reading batch 1 of 1, with subjects 3 through 5 (ie, 2 unique subject records).
#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
@@ -307,7 +307,7 @@ Additional Returned Information#> 1 rows were read from REDCap in 0.1 seconds. The http status code was 200.
#> 2 data access groups were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 1 columns were read from REDCap in 0.2 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-11-21 15:41:10.574863.
+#> Starting to read 5 records at 2024-12-08 16:36:18.052757.
#> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).
#> 5 records and 3 columns were read from REDCap in 0.2 seconds. The http status code was 200.
all_information #Inspect the additional information
@@ -352,7 +352,7 @@ Additional Returned Information#> [1] NA
#>
#> $elapsed_seconds
-#> [1] 1.557914
+#> [1] 1.639954
@@ -366,20 +366,20 @@ Session Information#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.4.2 (2024-10-31)
-#> os macOS Sonoma 14.7
+#> os macOS Sonoma 14.7.1
#> system aarch64, darwin20
#> ui X11
#> language en
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz UTC
-#> date 2024-11-21
+#> date 2024-12-08
#> pandoc 3.1.11 @ /usr/local/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> backports 1.5.0 2024-05-23 [1] CRAN (R 4.4.0)
-#> bit 4.5.0 2024-09-20 [1] CRAN (R 4.4.1)
+#> bit 4.5.0.1 2024-12-03 [1] CRAN (R 4.4.1)
#> bit64 4.5.2 2024-09-22 [1] CRAN (R 4.4.1)
#> bslib 0.8.0 2024-07-29 [1] CRAN (R 4.4.0)
#> cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
@@ -413,7 +413,7 @@ Session Information#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0)
#> ragg 1.3.3 2024-09-11 [1] CRAN (R 4.4.1)
#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
-#> REDCapR * 1.3.0.9000 2024-11-21 [1] local
+#> REDCapR * 1.3.0.9000 2024-12-08 [1] local
#> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0)
#> rmarkdown 2.29 2024-11-04 [1] CRAN (R 4.4.1)
#> rstudioapi 0.17.1 2024-10-22 [1] CRAN (R 4.4.1)
@@ -424,7 +424,7 @@ Session Information#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.4.0)
#> svglite 2.1.3 2023-12-08 [1] CRAN (R 4.4.0)
#> systemfonts 1.1.0 2024-05-15 [1] CRAN (R 4.4.0)
-#> textshaping 0.4.0 2024-05-24 [1] CRAN (R 4.4.0)
+#> textshaping 0.4.1 2024-12-06 [1] CRAN (R 4.4.1)
#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
#> tidyselect 1.2.1 2024-03-11 [1] CRAN (R 4.4.0)
#> tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.4.0)
@@ -441,7 +441,7 @@ Session Information#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
-Report rendered by runner at 2024-11-21, 15:41 +0000 in 11
+
Report rendered by runner at 2024-12-08, 16:36 +0000 in 12
seconds.
Additional Returned Information#> [1] NA
#>
#> $elapsed_seconds
-#> [1] 1.557914
+#> [1] 1.639954
@@ -366,20 +366,20 @@ Session Information#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.4.2 (2024-10-31)
-#> os macOS Sonoma 14.7
+#> os macOS Sonoma 14.7.1
#> system aarch64, darwin20
#> ui X11
#> language en
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz UTC
-#> date 2024-11-21
+#> date 2024-12-08
#> pandoc 3.1.11 @ /usr/local/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> backports 1.5.0 2024-05-23 [1] CRAN (R 4.4.0)
-#> bit 4.5.0 2024-09-20 [1] CRAN (R 4.4.1)
+#> bit 4.5.0.1 2024-12-03 [1] CRAN (R 4.4.1)
#> bit64 4.5.2 2024-09-22 [1] CRAN (R 4.4.1)
#> bslib 0.8.0 2024-07-29 [1] CRAN (R 4.4.0)
#> cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
@@ -413,7 +413,7 @@ Session Information#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0)
#> ragg 1.3.3 2024-09-11 [1] CRAN (R 4.4.1)
#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
-#> REDCapR * 1.3.0.9000 2024-11-21 [1] local
+#> REDCapR * 1.3.0.9000 2024-12-08 [1] local
#> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0)
#> rmarkdown 2.29 2024-11-04 [1] CRAN (R 4.4.1)
#> rstudioapi 0.17.1 2024-10-22 [1] CRAN (R 4.4.1)
@@ -424,7 +424,7 @@ Session Information#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.4.0)
#> svglite 2.1.3 2023-12-08 [1] CRAN (R 4.4.0)
#> systemfonts 1.1.0 2024-05-15 [1] CRAN (R 4.4.0)
-#> textshaping 0.4.0 2024-05-24 [1] CRAN (R 4.4.0)
+#> textshaping 0.4.1 2024-12-06 [1] CRAN (R 4.4.1)
#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
#> tidyselect 1.2.1 2024-03-11 [1] CRAN (R 4.4.0)
#> tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.4.0)
@@ -441,7 +441,7 @@ Session Information#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
-Report rendered by runner at 2024-11-21, 15:41 +0000 in 11
+
Report rendered by runner at 2024-12-08, 16:36 +0000 in 12
seconds.
Session Information#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.4.2 (2024-10-31)
-#> os macOS Sonoma 14.7
+#> os macOS Sonoma 14.7.1
#> system aarch64, darwin20
#> ui X11
#> language en
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz UTC
-#> date 2024-11-21
+#> date 2024-12-08
#> pandoc 3.1.11 @ /usr/local/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> backports 1.5.0 2024-05-23 [1] CRAN (R 4.4.0)
-#> bit 4.5.0 2024-09-20 [1] CRAN (R 4.4.1)
+#> bit 4.5.0.1 2024-12-03 [1] CRAN (R 4.4.1)
#> bit64 4.5.2 2024-09-22 [1] CRAN (R 4.4.1)
#> bslib 0.8.0 2024-07-29 [1] CRAN (R 4.4.0)
#> cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
@@ -413,7 +413,7 @@ Session Information#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0)
#> ragg 1.3.3 2024-09-11 [1] CRAN (R 4.4.1)
#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
-#> REDCapR * 1.3.0.9000 2024-11-21 [1] local
+#> REDCapR * 1.3.0.9000 2024-12-08 [1] local
#> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0)
#> rmarkdown 2.29 2024-11-04 [1] CRAN (R 4.4.1)
#> rstudioapi 0.17.1 2024-10-22 [1] CRAN (R 4.4.1)
@@ -424,7 +424,7 @@ Session Information#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.4.0)
#> svglite 2.1.3 2023-12-08 [1] CRAN (R 4.4.0)
#> systemfonts 1.1.0 2024-05-15 [1] CRAN (R 4.4.0)
-#> textshaping 0.4.0 2024-05-24 [1] CRAN (R 4.4.0)
+#> textshaping 0.4.1 2024-12-06 [1] CRAN (R 4.4.1)
#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
#> tidyselect 1.2.1 2024-03-11 [1] CRAN (R 4.4.0)
#> tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.4.0)
@@ -441,7 +441,7 @@ Session Information#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
-Report rendered by runner at 2024-11-21, 15:41 +0000 in 11
+
Report rendered by runner at 2024-12-08, 16:36 +0000 in 12
seconds.
Session Information#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.4.0)
#> svglite 2.1.3 2023-12-08 [1] CRAN (R 4.4.0)
#> systemfonts 1.1.0 2024-05-15 [1] CRAN (R 4.4.0)
-#> textshaping 0.4.0 2024-05-24 [1] CRAN (R 4.4.0)
+#> textshaping 0.4.1 2024-12-06 [1] CRAN (R 4.4.1)
#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
#> tidyselect 1.2.1 2024-03-11 [1] CRAN (R 4.4.0)
#> tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.4.0)
@@ -441,7 +441,7 @@ Session Information#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
-Report rendered by runner at 2024-11-21, 15:41 +0000 in 11
+
Report rendered by runner at 2024-12-08, 16:36 +0000 in 12
seconds.
Report rendered by runner at 2024-11-21, 15:41 +0000 in 11 +
Report rendered by runner at 2024-12-08, 16:36 +0000 in 12 seconds.