From bbe3234a0ba739d237c96fd2d1979a7c09ff1085 Mon Sep 17 00:00:00 2001
From: GitHub Actions Site built with pkgdown 2.0.7. Site built with pkgdown 2.0.9. Site built with pkgdown 2.0.7. Site built with pkgdown 2.0.9. Can you export from your own project? The code
@@ -764,33 +764,33 @@ Can you export your own project? The code is
@@ -891,7 +891,7 @@ Site built with pkgdown 2.0.7. Site built with pkgdown 2.0.9. Force the connection to use SSL=3 (which is not preferred, and
possibly insecure). Report rendered by runner at 2024-01-22, 17:11 +0000 in 3
+ Report rendered by runner at 2024-06-11, 17:21 +0000 in 2
seconds. Site built with pkgdown 2.0.7. Site built with pkgdown 2.0.9.Page not found (404)
diff --git a/CONDUCT.html b/CONDUCT.html
index 302374a3..3386da1d 100644
--- a/CONDUCT.html
+++ b/CONDUCT.html
@@ -1,5 +1,5 @@
-Contributor Code of Conduct
diff --git a/LICENSE-text.html b/LICENSE-text.html
index 88907a94..f356aaba 100644
--- a/LICENSE-text.html
+++ b/LICENSE-text.html
@@ -1,5 +1,5 @@
-License
diff --git a/LICENSE.html b/LICENSE.html
index d79a08e4..408d16d9 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -1,5 +1,5 @@
-MIT License
diff --git a/articles/BasicREDCapROperations.html b/articles/BasicREDCapROperations.html
index c5fe0f33..c8e2d7c2 100644
--- a/articles/BasicREDCapROperations.html
+++ b/articles/BasicREDCapROperations.html
@@ -12,7 +12,7 @@
-
+
@@ -86,7 +86,7 @@
Basic REDCapR Operations
- 2024-01-22
+ 2024-06-11
Source: vignettes/BasicREDCapROperations.Rmd
BasicREDCapROperations.Rmd
Read all records and fields#> 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.1 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-01-22 17:11:16.547907.
+#> 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-06-11 17:21:16.568606.
#> 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.1 seconds. The http status code was 200.
-ds_all_rows_all_fields # Inspect the returned dataset
+#> 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
#> # A tibble: 5 × 25
#> record_id name_first name_last address telephone email dob age sex
#> <dbl> <chr> <chr> <chr> <chr> <chr> <date> <dbl> <dbl>
@@ -165,7 +166,7 @@
Read a subset of the records
+
# Return only records with IDs of 1 and 3
desired_records <- c(1, 3)
ds_some_rows_v1 <- redcap_read(
@@ -174,14 +175,14 @@
Read a subset of the records= desired_records
)$data
#> 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.
+#> The data dictionary describing 17 fields was read from REDCap in 0.2 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.
-#> 2 records and 1 columns were read from REDCap in 0.1 seconds. The http status code was 200.
-#> Starting to read 2 records at 2024-01-22 17:11:18.365921.
+#> 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-06-11 17:21:18.490516.
#> 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.1 seconds. The http status code was 200.
Read a subset of the fields
@@ -196,7 +197,7 @@
Read a subset of the fields
+
# Return only the fields record_id, name_first, and age
desired_fields <- c("record_id", "name_first", "age")
ds_some_fields <- redcap_read(
@@ -206,13 +207,13 @@
Read a subset of the fields)$data
#> 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.
+#> 3 instrument metadata records were read from REDCap in 0.2 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.1 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-01-22 17:11:20.042749.
+#> 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-06-11 17:21:20.368304.
#> 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.1 seconds. The http status code was 200.
Read a subset of records, conditioned on the values in some
@@ -229,7 +230,7 @@
Re
desired
record_id
values are 3
&
5
. The second call to REDCap pulls all the
columns, but only for the identified records.
-
+
######
## Step 1: First call to REDCap
desired_fields_v3 <- c("record_id", "dob", "weight")
@@ -243,11 +244,12 @@
Re
#> 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.1 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-01-22 17:11:21.642398.
+#> 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-06-11 17:21:22.13694.
#> 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.1 seconds. The http status code was 200.
-
+#> 5 records and 3 columns were read from REDCap in 0.2 seconds. The http status code was 200.
+
ds_some_fields_v3 #Examine the these three variables.
#> # A tibble: 5 × 3
#> record_id dob weight
@@ -256,8 +258,9 @@
Re
#> 2 2 2003-03-10 1
#> 3 3 1934-04-09 80
#> 4 4 1952-11-02 54
-#> 5 5 1955-04-15 104
-
+#> 5 5 1955-04-15 104
+
######
## Step 2: identify desired records, based on age & weight
before_1960 <- (ds_some_fields_v3$dob <= as.Date("1960-01-01"))
@@ -265,8 +268,9 @@
Re
desired_records_v3 <- ds_some_fields_v3[before_1960 & heavier_than_70_kg, ]$record_id
desired_records_v3 #Peek at IDs of the identified records
-#> [1] 3 5
-
+#> [1] 3 5
+
######
## Step 3: second call to REDCap
#Return only records that met the age & weight criteria.
@@ -276,15 +280,16 @@
Re
records = desired_records_v3
)$data
#> 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.
+#> The data dictionary describing 17 fields was read from REDCap in 0.2 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.
-#> 2 records and 1 columns were read from REDCap in 0.1 seconds. The http status code was 200.
-#> Starting to read 2 records at 2024-01-22 17:11:23.197094.
+#> 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-06-11 17:21:24.040968.
#> 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.1 seconds. The http status code was 200.
-
+#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
+
ds_some_rows_v3 #Examine the results.
#> # A tibble: 2 × 25
#> record_id name_first name_last address telephone email dob age sex
@@ -323,7 +328,7 @@
Additional Returned InformationThe
elapsed_seconds
measures the duration of the
call.
-
+
#Return only the fields record_id, name_first, and age
all_information <- redcap_read(
redcap_uri = uri,
@@ -335,11 +340,12 @@
Additional Returned Information#> 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.1 seconds. The http status code was 200.
-#> Starting to read 5 records at 2024-01-22 17:11:24.849375.
+#> 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-06-11 17:21:25.964515.
#> 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.1 seconds. The http status code was 200.
-all_information #Inspect the additional information
+#> 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
#> $data
#> # A tibble: 5 × 3
#> record_id name_first age
@@ -357,7 +363,7 @@
Additional Returned Information#> [1] "200"
#>
#> $outcome_messages
-#> [1] "5 records and 3 columns were read from REDCap in 0.1 seconds. The http status code was 200."
+#> [1] "5 records and 3 columns were read from REDCap in 0.2 seconds. The http status code was 200."
#>
#> $records_collapsed
#> [1] ""
@@ -381,7 +387,7 @@
Additional Returned Information#> [1] NA
#>
#> $elapsed_seconds
-#> [1] 1.430104
Session Information
-
Security Database
- 2024-01-22
+ 2024-06-11
Source: vignettes/SecurityDatabase.Rmd
SecurityDatabase.Rmd
Create DatabaseREDCapR::retrieve_credential_mssql(). In this example,
we’ve arbitrarily called the database
auxiliary_security
.
-------- SQL code to create necessary components in a Microsoft SQL Sever database -------
-
------------------------------------------------------------------------
--- Create two schemas.
--- The first schema is accessible by all REDCap API users.
--- The second schema is restricted to administrators.
---
-CREATE SCHEMA [redcap]
-CREATE SCHEMA [redcap_private]
-
- GO
------------------------------------------------------------------------
--- Create a table to contain the token
-CREATE TABLE redcap_private.tbl_credential (
-id smallint primary key,
- varchar(30) not null,
- username smallint not null,
- project_id instance varchar(30) not null,
- char(32) not null,
- token varchar(255) not null
- redcap_uri
- )
-CREATE UNIQUE NONCLUSTERED INDEX IX_tbl_credential_unique ON redcap_private.tbl_credential (
-instance asc,
- asc,
- project_id asc
- username
- )
------------------------------------------------------------------------
--- Create a stored procedure for users to call to retrieve the token.
--- Notice it should a different (and more permissive) schema than the table.
---
-CREATE PROCEDURE redcap.prc_credential
-smallint,
- @project_id varchar(30)
- @instance AS
-BEGIN
-SET NOCOUNT ON;
-
-SELECT username, project_id, token, redcap_uri FROM redcap_private.tbl_credential
- WHERE
- = system_user -- The username from the server's OS.
- username AND
- = @project_id -- Restricts to the desired REDCap project.
- project_id AND
- instance = @instance -- System accommodates multiple REDCap instances.
- END
------- SQL code to create necessary components in a Microsoft SQL Sever database -------
+
+-----------------------------------------------------------------------
+-- Create two schemas.
+-- The first schema is accessible by all REDCap API users.
+-- The second schema is restricted to administrators.
+--
+CREATE SCHEMA [redcap]
+CREATE SCHEMA [redcap_private]
+GO
+
+-----------------------------------------------------------------------
+-- Create a table to contain the token
+CREATE TABLE redcap_private.tbl_credential (
+ id smallint primary key,
+ username varchar(30) not null,
+ project_id smallint not null,
+ instance varchar(30) not null,
+ token char(32) not null,
+ redcap_uri varchar(255) not null
+)
+
+CREATE UNIQUE NONCLUSTERED INDEX IX_tbl_credential_unique ON redcap_private.tbl_credential (
+ instance asc,
+ project_id asc,
+ username asc
+)
+
+-----------------------------------------------------------------------
+-- Create a stored procedure for users to call to retrieve the token.
+-- Notice it should a different (and more permissive) schema than the table.
+--
+CREATE PROCEDURE redcap.prc_credential
+ @project_id smallint,
+ @instance varchar(30)
+AS
+BEGIN
+ SET NOCOUNT ON;
+
+ SELECT username, project_id, token, redcap_uri FROM redcap_private.tbl_credential
+ WHERE
+ username = system_user -- The username from the server's OS.
+ AND
+ project_id = @project_id -- Restricts to the desired REDCap project.
+ AND
+ instance = @instance -- System accommodates multiple REDCap instances.
+END
Create user credentials to the auxiliary database
@@ -208,80 +208,80 @@
Create user credentia
‘redcap_private’ schema. Typical users should not be authorized for this
schema. The current system allows typical users to view only their own
tokens.
-
-----------------------------------------------------------------------
--- Add a user account to the auxiliary_security database so that they can query the tables to retrieve their API.
--- Notice that this only gives the permissions to retrieve the token. You must still:
--- 1) grant them API privileges to each appropriate REDCap project, and
--- 2) copy the API from the REDCap database into the auxiliary_security database.
--- Also, do not give typical users authorization for the 'redcap_private' schema. The current system allows them to view only their own tokens.
------------------------------------------------------------------------
-
--- STEP #1: Declare the user name. If everything runs correctly, this should be the only piece of code that you need to modify.
-'Step #1 executing....'
- print USE [master]
-
- GODECLARE @qualified_user_name varchar(255); SET @qualified_user_name = '[OUHSC\lsuarez3]'
-'Resulting login name: ' + @qualified_user_name; print ''
- print
---EXEC sp_helplogins @LoginNamePattern=@qualified_user_name
---SELECT * FROM master..syslogins WHERE name = @qualified_user_name
---SELECT * FROM auxiliary_security.sys.sysusers
---SELECT * FROM sys.database_permissions
---SELECT * FROM sys.server_principals
-
------------------------------------------------------------------------
--- STEP #2: Create a login for the *server*.
-'Step #2 executing....'
- print DECLARE @sql_create_login nvarchar(max)
-SET @sql_create_login = 'CREATE LOGIN ' + @qualified_user_name + ' FROM WINDOWS WITH DEFAULT_DATABASE=[auxiliary_security]'
-EXECUTE sp_executesql @sql_create_login
-DECLARE @login_count AS INT; SET @login_count = (SELECT COUNT(*) AS login_count FROM master..syslogins WHERE '[' + loginname + ']' = @qualified_user_name)
-'Logins matching desired name should equal 1. It equals: ' + CONVERT(varchar, @login_count); print ''
- print
------------------------------------------------------------------------
--- STEP #3: Create a user account for the *database*, after switching the database under focus to auxiliary_security.
-'Step #3 executing....'
- print USE [auxiliary_security]
-DECLARE @sql_create_user nvarchar(max)
-SET @sql_create_user = 'CREATE USER ' + @qualified_user_name + ' FOR LOGIN ' + @qualified_user_name
-EXECUTE sp_executesql @sql_create_user
-DECLARE @user_count AS INT; SET @user_count = (SELECT COUNT(*) AS user_count FROM auxiliary_security.sys.sysusers WHERE '[' + name + ']' = @qualified_user_name)
-'User accounts matching desired name should equal 1. It equals: ' + CONVERT(varchar, @user_count); print ''
- print
------------------------------------------------------------------------
--- STEP #4: Grant appropriate privileges for the 'redcap' schema.
-'Step #4 executing....'
- print DECLARE @sql_grant_schema_redcap nvarchar(max)
-SET @sql_grant_schema_redcap = 'GRANT EXECUTE ON SCHEMA::[redcap] TO ' + @qualified_user_name
-EXECUTE sp_executesql @sql_grant_schema_redcap
-'Step #4 executed'; print ''
- print
------------------------------------------------------------------------
--- STEP #5: Grant appropriate privileges for the 'Security' schema.
-'Step #5 executing....'
- print DECLARE @sql_grant_schema_security nvarchar(max)
-SET @sql_grant_schema_security = 'GRANT EXECUTE ON SCHEMA::[security] TO ' + @qualified_user_name
-EXECUTE sp_executesql @sql_grant_schema_security
-'Step #5 executed'; print ''
- print
------------------------------------------------------------------------
--- OPTIONAL STEP: Delete the user from the database (the first line) and then the server (the second line).
--- The person's other database user accounts (besides with the auxiliary_security database) will NOT be automatically deleted by these two lines.
---USE [auxiliary_security]; DROP USER [OUHSC\lsuarez3]
---USE [master]; DROP LOGIN [OUHSC\lsuarez3]
-
------------------------------------------------------------------------
--- REFERENCES & NOTES
---The @qualified_user_name must have both (a) the 'OUHSC' domain qualification, and (b) the square brackets (to escape the backslash).
- --Using sp_executesql to add users: https://www.sqlservercentral.com/Forums/Topic497615-359-1.aspx
- --Check if a server login exists: https://stackoverflow.com/questions/37275/sql-query-for-logins
- --Retrieve database users: https://stackoverflow.com/questions/2445444/how-to-get-a-list-of-users-for-all-instances-databases
- --Concatenating strings: https://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/
- --DROP USER from database: https://msdn.microsoft.com/en-us/library/ms189438.aspx
- --DROP LOGIN from server: https://msdn.microsoft.com/en-us/library/ms188012.aspx
- --Declaring variables (eg, the username above): https://technet.microsoft.com/en-us/library/aa258839.aspx
- --A different (& non-dynamic) way to establish a user: https://pic.dhe.ibm.com/infocenter/dmndhelp/v8r5m0/index.jsp?topic=%2Fcom.ibm.wbpm.imuc.sbpm.doc%2Ftopics%2Fdb_create_users_nd_aix.html
- --If the variable has to cross a 'GO' (which the current version of the script doesn't need): https://stackoverflow.com/questions/937336/is-there-a-way-to-persist-a-variable-across-a-go
-----------------------------------------------------------------------
+-- Add a user account to the auxiliary_security database so that they can query the tables to retrieve their API.
+-- Notice that this only gives the permissions to retrieve the token. You must still:
+-- 1) grant them API privileges to each appropriate REDCap project, and
+-- 2) copy the API from the REDCap database into the auxiliary_security database.
+-- Also, do not give typical users authorization for the 'redcap_private' schema. The current system allows them to view only their own tokens.
+-----------------------------------------------------------------------
+
+-- STEP #1: Declare the user name. If everything runs correctly, this should be the only piece of code that you need to modify.
+print 'Step #1 executing....'
+USE [master]
+GO
+DECLARE @qualified_user_name varchar(255); SET @qualified_user_name = '[OUHSC\lsuarez3]'
+print 'Resulting login name: ' + @qualified_user_name; print ''
+
+--EXEC sp_helplogins @LoginNamePattern=@qualified_user_name
+--SELECT * FROM master..syslogins WHERE name = @qualified_user_name
+--SELECT * FROM auxiliary_security.sys.sysusers
+--SELECT * FROM sys.database_permissions
+--SELECT * FROM sys.server_principals
+
+-----------------------------------------------------------------------
+-- STEP #2: Create a login for the *server*.
+print 'Step #2 executing....'
+DECLARE @sql_create_login nvarchar(max)
+SET @sql_create_login = 'CREATE LOGIN ' + @qualified_user_name + ' FROM WINDOWS WITH DEFAULT_DATABASE=[auxiliary_security]'
+EXECUTE sp_executesql @sql_create_login
+DECLARE @login_count AS INT; SET @login_count = (SELECT COUNT(*) AS login_count FROM master..syslogins WHERE '[' + loginname + ']' = @qualified_user_name)
+print 'Logins matching desired name should equal 1. It equals: ' + CONVERT(varchar, @login_count); print ''
+
+-----------------------------------------------------------------------
+-- STEP #3: Create a user account for the *database*, after switching the database under focus to auxiliary_security.
+print 'Step #3 executing....'
+USE [auxiliary_security]
+DECLARE @sql_create_user nvarchar(max)
+SET @sql_create_user = 'CREATE USER ' + @qualified_user_name + ' FOR LOGIN ' + @qualified_user_name
+EXECUTE sp_executesql @sql_create_user
+DECLARE @user_count AS INT; SET @user_count = (SELECT COUNT(*) AS user_count FROM auxiliary_security.sys.sysusers WHERE '[' + name + ']' = @qualified_user_name)
+print 'User accounts matching desired name should equal 1. It equals: ' + CONVERT(varchar, @user_count); print ''
+
+-----------------------------------------------------------------------
+-- STEP #4: Grant appropriate privileges for the 'redcap' schema.
+print 'Step #4 executing....'
+DECLARE @sql_grant_schema_redcap nvarchar(max)
+SET @sql_grant_schema_redcap = 'GRANT EXECUTE ON SCHEMA::[redcap] TO ' + @qualified_user_name
+EXECUTE sp_executesql @sql_grant_schema_redcap
+print 'Step #4 executed'; print ''
+
+-----------------------------------------------------------------------
+-- STEP #5: Grant appropriate privileges for the 'Security' schema.
+print 'Step #5 executing....'
+DECLARE @sql_grant_schema_security nvarchar(max)
+SET @sql_grant_schema_security = 'GRANT EXECUTE ON SCHEMA::[security] TO ' + @qualified_user_name
+EXECUTE sp_executesql @sql_grant_schema_security
+print 'Step #5 executed'; print ''
+
+-----------------------------------------------------------------------
+-- OPTIONAL STEP: Delete the user from the database (the first line) and then the server (the second line).
+-- The person's other database user accounts (besides with the auxiliary_security database) will NOT be automatically deleted by these two lines.
+--USE [auxiliary_security]; DROP USER [OUHSC\lsuarez3]
+--USE [master]; DROP LOGIN [OUHSC\lsuarez3]
+
+-----------------------------------------------------------------------
+-- REFERENCES & NOTES
+ --The @qualified_user_name must have both (a) the 'OUHSC' domain qualification, and (b) the square brackets (to escape the backslash).
+ --Using sp_executesql to add users: https://www.sqlservercentral.com/Forums/Topic497615-359-1.aspx
+ --Check if a server login exists: https://stackoverflow.com/questions/37275/sql-query-for-logins
+ --Retrieve database users: https://stackoverflow.com/questions/2445444/how-to-get-a-list-of-users-for-all-instances-databases
+ --Concatenating strings: https://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/
+ --DROP USER from database: https://msdn.microsoft.com/en-us/library/ms189438.aspx
+ --DROP LOGIN from server: https://msdn.microsoft.com/en-us/library/ms188012.aspx
+ --Declaring variables (eg, the username above): https://technet.microsoft.com/en-us/library/aa258839.aspx
+ --A different (& non-dynamic) way to establish a user: https://pic.dhe.ibm.com/infocenter/dmndhelp/v8r5m0/index.jsp?topic=%2Fcom.ibm.wbpm.imuc.sbpm.doc%2Ftopics%2Fdb_create_users_nd_aix.html
+ --If the variable has to cross a 'GO' (which the current version of the script doesn't need): https://stackoverflow.com/questions/937336/is-there-a-way-to-persist-a-variable-across-a-go
Transfer Credentials
@@ -297,161 +297,161 @@
Transfer Credentials
rm(list=ls(all=TRUE)) #Clear the memory for any variables set from any previous runs.
-
-# ---- load-sources ------------------------------------------------------------
-
-# ---- load-packages -----------------------------------------------------------
-if (!require(OuhscMunge))
-stop('The `OuhscMunge` package needs to be installed with `remotes::install_github("OuhscBbmc/OuhscMunge")`.')
-
-::assert(
- testit"The `OuhscMunge` package should meet a minimal version.",
- compareVersion( as.character(packageVersion("OuhscMunge")), "0.1.9.9009") >= 0L
-
- )
-library(magrittr)
-requireNamespace("DBI")
-requireNamespace("odbc")
-requireNamespace("dplyr")
-requireNamespace("readr")
-requireNamespace("tibble")
-requireNamespace("testit")
-requireNamespace("checkmate")
-requireNamespace("OuhscMunge") # remotes::install_github("OuhscBbmc/OuhscMunge")
-
-
-# ---- declare-globals ---------------------------------------------------------
-# This file assume your campus has two REDCap instances.
-# Modify each (a) database name, (b) REDCap URL, and (c) DSN name.
-
-<- "production"
- name_production <- "dev"
- name_dev
-<- "https://redcap-production.ouhsc.edu/redcap/api/",
- uri_production <- "https://redcap-dev.ouhsc.edu/redcap/api/"
- uri_dev
-<- "redcap-production"
- dsn_production <- "redcap-dev"
- dsn_dev <- "auxiliary_security" # The DSN of the token server.
- dsn_source
-# The Activity Directory name that should precede each username.
-# This should correspond with the result of SQL Server's `SYSTEM_USER` function
-# (https://msdn.microsoft.com/en-us/library/ms179930.aspx)
-<- "OUHSC\\"
- ldap_prefix
-####
-# Nothing below this line should need to change, assuming:
-# 1. the vignette was followed exactly (https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html),
-# 2. your campus has exactly two REDCap instances.
-
-# SQL sent to the MySQL database underneath each REDCap instance.
-<- "
- sql SELECT username, project_id, api_token
- FROM redcap_user_rights
- WHERE api_token IS NOT NULL
-"
-
-# Update this ad-hoc CSV. Each row should represent one REDCap instance.
-<- tibble::tribble(
- ds_url ~instance , ~redcap_uri,
-
- name_production , uri_production,
- name_dev , uri_dev
- )
-# Remove variables that aren't used below.
-rm(uri_production, uri_dev)
-
-
-# ---- load-data ---------------------------------------------------------------
-
-# Load the credentials from the first/production REDCap instance.
-<- DBI::dbConnect(odbc::odbc(), dsn=dsn_production)
- cnn_production <- DBI::dbGetQuery(cnn_production, sql)
- ds_production ::dbDisconnect(cnn_production); rm(cnn_production, dsn_production)
- DBI
-# Load the credentials from the second/dev REDCap instance.
-<- DBI::dbConnect(odbc::odbc(), dsn=dsn_dev)
- cnn_dev <- DBI::dbGetQuery(cnn_dev, sql)
- ds_dev ::dbDisconnect(cnn_dev); rm(cnn_dev, dsn_dev)
- DBI
-rm(sql)
-
-# Assert these are valid datasets and contain at least 5 rows.
-# Adjust '5' to smaller value if necessary. It's just to catch blatant retrieval problems.
-::assert_data_frame(ds_production, min.rows=5)
- checkmate::assert_data_frame(ds_dev , min.rows=5)
- checkmate
-
-# ---- tweak-data --------------------------------------------------------------
-
-# Label each instance, so they're distinguishable later.
-$instance <- name_production
- ds_production$instance <- name_dev
- ds_dev
-# Stack the token collection from each instance. Then prefix the username and include the URL of each instance.
-<-
- ds %>%
- ds_production ::union(ds_dev) %>% # Remove union if the dev instance isn't included.
- dplyr::as_tibble() %>%
- tibble::select(
- dplyrusername = username,
- project_id = project_id,
- instance = instance,
- token = api_token
- %>%
- ) ::mutate(
- dplyrusername = paste0(ldap_prefix, username), # Qualify for the Active Directory.
- %>%
- ) ::left_join( ds_url, by="instance") %>% # Include the instance URL.
- dplyr::arrange(instance, project_id, username) %>%
- dplyr::rowid_to_column("id") # For the sake of a clustered primary key.
- tibble
-rm(ds_production, ds_dev, ds_url)
-rm(name_production, name_dev)
-rm(ldap_prefix)
-
-
-# ---- verify-values -----------------------------------------------------------
-
-# Assert that the dataset is well-behaved.
-# OuhscMunge::verify_value_headstart(ds)
-::assert_integer( ds$id , any.missing=FALSE, lower=1, upper=.Machine$integer.max, unique=TRUE)
- checkmate::assert_character(ds$username , any.missing=FALSE, pattern="^.{1,255}$" )
- checkmate::assert_integer( ds$project_id , any.missing=FALSE, lower=1, upper=.Machine$integer.max )
- checkmate::assert_character(ds$token , any.missing=FALSE, pattern="^[A-Z0-9]{32}$" , unique=TRUE)
- checkmate::assert_character(ds$instance , any.missing=FALSE, pattern="^.{1,255}$" )
- checkmate::assert_character(ds$redcap_uri , any.missing=FALSE, pattern="^.{1,255}$" )
- checkmate
-::assert(
- testit"The `username` x `project_id` x `instance` must be unique.",
- sum(duplicated(paste0(ds$username, "-", ds$project_id, "-", ds$instance))) == 0L
-
- )
-::assert("At least 10 tokens should be ready to write." , 10L <= nrow(ds))
- testit
-
-# ---- specify-columns-to-upload -----------------------------------------------
-
-# Dictate the exact columns and order that will be uploaded.
-<- c("id", "username", "project_id", "instance", "token", "redcap_uri")
- columns_to_write <- ds[, columns_to_write]
- ds_slim rm(columns_to_write)
-
-
-# ---- upload-to-db ------------------------------------------------------------------
-
-::upload_sqls_odbc(
- OuhscMunged = ds_slim,
- schema_name = "redcap_private",
- table_name = "tbl_credential",
- dsn_name = dsn_source,
- create_table = FALSE,
- clear_table = TRUE,
- transaction = TRUE,
- verbose = TRUE
-
- )# Uploading 252 tokens takes 0.004 minutes.
rm(list=ls(all=TRUE)) #Clear the memory for any variables set from any previous runs.
+
+# ---- load-sources ------------------------------------------------------------
+
+# ---- load-packages -----------------------------------------------------------
+if (!require(OuhscMunge))
+ stop('The `OuhscMunge` package needs to be installed with `remotes::install_github("OuhscBbmc/OuhscMunge")`.')
+
+testit::assert(
+ "The `OuhscMunge` package should meet a minimal version.",
+ compareVersion( as.character(packageVersion("OuhscMunge")), "0.1.9.9009") >= 0L
+)
+
+library(magrittr)
+requireNamespace("DBI")
+requireNamespace("odbc")
+requireNamespace("dplyr")
+requireNamespace("readr")
+requireNamespace("tibble")
+requireNamespace("testit")
+requireNamespace("checkmate")
+requireNamespace("OuhscMunge") # remotes::install_github("OuhscBbmc/OuhscMunge")
+
+
+# ---- declare-globals ---------------------------------------------------------
+# This file assume your campus has two REDCap instances.
+# Modify each (a) database name, (b) REDCap URL, and (c) DSN name.
+
+name_production <- "production"
+name_dev <- "dev"
+
+uri_production <- "https://redcap-production.ouhsc.edu/redcap/api/",
+uri_dev <- "https://redcap-dev.ouhsc.edu/redcap/api/"
+
+dsn_production <- "redcap-production"
+dsn_dev <- "redcap-dev"
+dsn_source <- "auxiliary_security" # The DSN of the token server.
+
+# The Activity Directory name that should precede each username.
+# This should correspond with the result of SQL Server's `SYSTEM_USER` function
+# (https://msdn.microsoft.com/en-us/library/ms179930.aspx)
+ldap_prefix <- "OUHSC\\"
+
+####
+# Nothing below this line should need to change, assuming:
+# 1. the vignette was followed exactly (https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html),
+# 2. your campus has exactly two REDCap instances.
+
+# SQL sent to the MySQL database underneath each REDCap instance.
+sql <- "
+ SELECT username, project_id, api_token
+ FROM redcap_user_rights
+ WHERE api_token IS NOT NULL
+"
+
+# Update this ad-hoc CSV. Each row should represent one REDCap instance.
+ds_url <- tibble::tribble(
+ ~instance , ~redcap_uri,
+ name_production , uri_production,
+ name_dev , uri_dev
+)
+
+# Remove variables that aren't used below.
+rm(uri_production, uri_dev)
+
+
+# ---- load-data ---------------------------------------------------------------
+
+# Load the credentials from the first/production REDCap instance.
+cnn_production <- DBI::dbConnect(odbc::odbc(), dsn=dsn_production)
+ds_production <- DBI::dbGetQuery(cnn_production, sql)
+DBI::dbDisconnect(cnn_production); rm(cnn_production, dsn_production)
+
+# Load the credentials from the second/dev REDCap instance.
+cnn_dev <- DBI::dbConnect(odbc::odbc(), dsn=dsn_dev)
+ds_dev <- DBI::dbGetQuery(cnn_dev, sql)
+DBI::dbDisconnect(cnn_dev); rm(cnn_dev, dsn_dev)
+
+rm(sql)
+
+# Assert these are valid datasets and contain at least 5 rows.
+# Adjust '5' to smaller value if necessary. It's just to catch blatant retrieval problems.
+checkmate::assert_data_frame(ds_production, min.rows=5)
+checkmate::assert_data_frame(ds_dev , min.rows=5)
+
+
+# ---- tweak-data --------------------------------------------------------------
+
+# Label each instance, so they're distinguishable later.
+ds_production$instance <- name_production
+ds_dev$instance <- name_dev
+
+# Stack the token collection from each instance. Then prefix the username and include the URL of each instance.
+ds <-
+ ds_production %>%
+ dplyr::union(ds_dev) %>% # Remove union if the dev instance isn't included.
+ tibble::as_tibble() %>%
+ dplyr::select(
+ username = username,
+ project_id = project_id,
+ instance = instance,
+ token = api_token
+ ) %>%
+ dplyr::mutate(
+ username = paste0(ldap_prefix, username), # Qualify for the Active Directory.
+ ) %>%
+ dplyr::left_join( ds_url, by="instance") %>% # Include the instance URL.
+ dplyr::arrange(instance, project_id, username) %>%
+ tibble::rowid_to_column("id") # For the sake of a clustered primary key.
+
+rm(ds_production, ds_dev, ds_url)
+rm(name_production, name_dev)
+rm(ldap_prefix)
+
+
+# ---- verify-values -----------------------------------------------------------
+
+# Assert that the dataset is well-behaved.
+# OuhscMunge::verify_value_headstart(ds)
+checkmate::assert_integer( ds$id , any.missing=FALSE, lower=1, upper=.Machine$integer.max, unique=TRUE)
+checkmate::assert_character(ds$username , any.missing=FALSE, pattern="^.{1,255}$" )
+checkmate::assert_integer( ds$project_id , any.missing=FALSE, lower=1, upper=.Machine$integer.max )
+checkmate::assert_character(ds$token , any.missing=FALSE, pattern="^[A-Z0-9]{32}$" , unique=TRUE)
+checkmate::assert_character(ds$instance , any.missing=FALSE, pattern="^.{1,255}$" )
+checkmate::assert_character(ds$redcap_uri , any.missing=FALSE, pattern="^.{1,255}$" )
+
+testit::assert(
+ "The `username` x `project_id` x `instance` must be unique.",
+ sum(duplicated(paste0(ds$username, "-", ds$project_id, "-", ds$instance))) == 0L
+)
+
+testit::assert("At least 10 tokens should be ready to write." , 10L <= nrow(ds))
+
+
+# ---- specify-columns-to-upload -----------------------------------------------
+
+# Dictate the exact columns and order that will be uploaded.
+columns_to_write <- c("id", "username", "project_id", "instance", "token", "redcap_uri")
+ds_slim <- ds[, columns_to_write]
+rm(columns_to_write)
+
+
+# ---- upload-to-db ------------------------------------------------------------------
+
+OuhscMunge::upload_sqls_odbc(
+ d = ds_slim,
+ schema_name = "redcap_private",
+ table_name = "tbl_credential",
+ dsn_name = dsn_source,
+ create_table = FALSE,
+ clear_table = TRUE,
+ transaction = TRUE,
+ verbose = TRUE
+)
+# Uploading 252 tokens takes 0.004 minutes.
Document Info
@@ -479,7 +479,7 @@
Document Info
-
Troubleshooting REDCap API Calls
- 2024-01-22
+ 2024-06-11
Source: vignettes/TroubleshootingApiCalls.Rmd
TroubleshootingApiCalls.Rmd
Reading with the REDCapR PackageThe previous code should produce similar output. Notice there are
five rows and the columns will wrap around if your console window is too
narrow.
-
5 records and 1 columns were read from REDCap in 0.41 seconds.
-5 records at 2014-06-27 17:19:49
- Starting to read 1 of 1, with ids 1 through 5.
- Reading batch 5 records and 16 columns were read from REDCap in 0.42 seconds.
-
-
- record_id name_first name_last address telephone email1 1 Nutmeg Nutmouse 14 Rose Cottage St.\nKenning UK, 323232 (432) 456-4848 nutty@mouse.com
-2 2 Tumtum Nutmouse 14 Rose Cottage Blvd.\nKenning UK 34243 (234) 234-2343 tummy@mouse.comm
-3 3 Marcus Wood 243 Hill St.\nGuthrie OK 73402 (433) 435-9865 mw@mwood.net
-4 4 Trudy DAG 342 Elm\nDuncanville TX, 75116 (987) 654-3210 peroxide@blonde.com
-5 5 John Lee Walker Hotel Suite\nNew Orleans LA, 70115 (333) 333-4444 left@hippocket.com
-
-
- dob age ethnicity race sex height weight bmi1 2003-08-30 10 1 2 0 5.00 1 400.0
-2 2003-03-10 10 1 6 1 6.00 1 277.8
-3 1934-04-09 79 0 4 1 180.00 80 24.7
-4 1952-11-02 61 1 4 0 165.00 54 19.8
-5 1955-04-15 58 1 4 1 193.04 104 27.9
-
-
- comments1 Character in a book, with some guessing
-2 A mouse character from a good book
-3 completely made up
-4 This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail
-5 Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache
-
- demographics_complete
-1 2
-2 2
-3 2
-4 2
-5 2
5 records and 1 columns were read from REDCap in 0.41 seconds.
+Starting to read 5 records at 2014-06-27 17:19:49
+Reading batch 1 of 1, with ids 1 through 5.
+5 records and 16 columns were read from REDCap in 0.42 seconds.
+
+ record_id name_first name_last address telephone email
+1 1 Nutmeg Nutmouse 14 Rose Cottage St.\nKenning UK, 323232 (432) 456-4848 nutty@mouse.com
+2 2 Tumtum Nutmouse 14 Rose Cottage Blvd.\nKenning UK 34243 (234) 234-2343 tummy@mouse.comm
+3 3 Marcus Wood 243 Hill St.\nGuthrie OK 73402 (433) 435-9865 mw@mwood.net
+4 4 Trudy DAG 342 Elm\nDuncanville TX, 75116 (987) 654-3210 peroxide@blonde.com
+5 5 John Lee Walker Hotel Suite\nNew Orleans LA, 70115 (333) 333-4444 left@hippocket.com
+
+ dob age ethnicity race sex height weight bmi
+1 2003-08-30 10 1 2 0 5.00 1 400.0
+2 2003-03-10 10 1 6 1 6.00 1 277.8
+3 1934-04-09 79 0 4 1 180.00 80 24.7
+4 1952-11-02 61 1 4 0 165.00 54 19.8
+5 1955-04-15 58 1 4 1 193.04 104 27.9
+
+ comments
+1 Character in a book, with some guessing
+2 A mouse character from a good book
+3 completely made up
+4 This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail
+5 Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache
+
+ demographics_complete
+1 2
+2 2
+3 2
+4 2
+5 2
Reading with the redcapAPI PackageThe previous code should produce similar output. Notice there are
five rows and the columns will wrap around if your console window is too
narrow.
-
- record_id name_first name_last address telephone email1 1 Nutmeg Nutmouse 14 Rose Cottage St.\nKenning UK, 323232 (432) 456-4848 nutty@mouse.com
-2 2 Tumtum Nutmouse 14 Rose Cottage Blvd.\nKenning UK 34243 (234) 234-2343 tummy@mouse.comm
-3 3 Marcus Wood 243 Hill St.\nGuthrie OK 73402 (433) 435-9865 mw@mwood.net
-4 4 Trudy DAG 342 Elm\nDuncanville TX, 75116 (987) 654-3210 peroxide@blonde.com
-5 5 John Lee Walker Hotel Suite\nNew Orleans LA, 70115 (333) 333-4444 left@hippocket.com
-
-
- dob age ethnicity race sex height weight bmi1 2003-08-30 10 1 2 0 5.00 1 400.0
-2 2003-03-10 10 1 6 1 6.00 1 277.8
-3 1934-04-09 79 0 4 1 180.00 80 24.7
-4 1952-11-02 61 1 4 0 165.00 54 19.8
-5 1955-04-15 58 1 4 1 193.04 104 27.9
-
-
- comments1 Character in a book, with some guessing
-2 A mouse character from a good book
-3 completely made up
-4 This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail
-5 Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache
-
-demographics_complete
-1 2
-2 2
-3 2
-4 2
-5 2
record_id name_first name_last address telephone email
+1 1 Nutmeg Nutmouse 14 Rose Cottage St.\nKenning UK, 323232 (432) 456-4848 nutty@mouse.com
+2 2 Tumtum Nutmouse 14 Rose Cottage Blvd.\nKenning UK 34243 (234) 234-2343 tummy@mouse.comm
+3 3 Marcus Wood 243 Hill St.\nGuthrie OK 73402 (433) 435-9865 mw@mwood.net
+4 4 Trudy DAG 342 Elm\nDuncanville TX, 75116 (987) 654-3210 peroxide@blonde.com
+5 5 John Lee Walker Hotel Suite\nNew Orleans LA, 70115 (333) 333-4444 left@hippocket.com
+
+ dob age ethnicity race sex height weight bmi
+1 2003-08-30 10 1 2 0 5.00 1 400.0
+2 2003-03-10 10 1 6 1 6.00 1 277.8
+3 1934-04-09 79 0 4 1 180.00 80 24.7
+4 1952-11-02 61 1 4 0 165.00 54 19.8
+5 1955-04-15 58 1 4 1 193.04 104 27.9
+
+ comments
+1 Character in a book, with some guessing
+2 A mouse character from a good book
+3 completely made up
+4 This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail
+5 Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache
+
+demographics_complete
+1 2
+2 2
+3 2
+4 2
+5 2
Document Info
-
Advanced REDCapR Operations
- 2024-01-22
+ 2024-06-11
Source: vignettes/advanced-redcapr-operations.Rmd
advanced-redcapr-operations.Rmd
Query the Underlying MySQL Database
which is helpful if you need a timestamp from surveys that were not
marked as completed. Replace ‘444’ with your pid, and 1001 through 1003
with the desired events.
-
SELECT
-as participant_survey_id
- p.participant_id record as record_id
- ,r.
- ,p.event_idas event_name
- ,e.descrip
- ,r.first_submit_time
- ,r.completion_time
--- ,p.*
- -- ,r.*
- FROM redcapv3.redcap_surveys_participants as p
-left join redcapv3.redcap_surveys_response as r on p.participant_id = r.participant_id
- left join redcapv3.redcap_events_metadata as e on p.event_id = e.event_id
- WHERE
-= 444
- p.survey_id and
- in (
- p.event_id 1001, -- start of the year
- 1002, -- mid term
- 1003 -- end of year
- )
SELECT
+ p.participant_id as participant_survey_id
+ ,r.record as record_id
+ ,p.event_id
+ ,e.descrip as event_name
+ ,r.first_submit_time
+ ,r.completion_time
+
+ -- ,p.*
+ -- ,r.*
+FROM redcapv3.redcap_surveys_participants as p
+ left join redcapv3.redcap_surveys_response as r on p.participant_id = r.participant_id
+ left join redcapv3.redcap_events_metadata as e on p.event_id = e.event_id
+WHERE
+ p.survey_id = 444
+ and
+ p.event_id in (
+ 1001, -- start of the year
+ 1002, -- mid term
+ 1003 -- end of year
+ )
SSL Options
@@ -358,7 +358,7 @@
SSL Options= config_options
)$data
}
+#> 5 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
@@ -368,7 +368,7 @@
SSL Options= token_simple,
config_options = config_options
)$data
+#> 5 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
config_options <- list(ssl.verifypeer = FALSE)
ds_no_ssl <- redcap_read_oneshot(
@@ -376,7 +376,7 @@
SSL Options= token_simple,
config_options = config_options
)$data
+#> 5 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200.
#> 5 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.
Convert SPSS Output to REDCap data dictionary
@@ -405,88 +405,86 @@
Session Information
-#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
-#> version R version 4.3.2 (2023-10-31)
-#> os macOS Monterey 12.7.2
-#> system x86_64, darwin20
+#> version R version 4.4.0 (2024-04-24)
+#> os macOS Sonoma 14.5
+#> system aarch64, darwin20
#> ui X11
#> language en
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz UTC
-#> date 2024-01-22
-#> pandoc 2.19.2 @ /usr/local/bin/ (via rmarkdown)
+#> date 2024-06-11
+#> pandoc 3.1.11 @ /usr/local/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
-#> backports 1.4.1 2021-12-13 [1] CRAN (R 4.3.0)
-#> bit 4.0.5 2022-11-15 [1] CRAN (R 4.3.0)
-#> bit64 4.0.5 2020-08-30 [1] CRAN (R 4.3.0)
-#> bslib 0.6.1 2023-11-28 [1] CRAN (R 4.3.0)
-#> cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0)
-#> checkmate 2.3.1 2023-12-04 [1] CRAN (R 4.3.0)
-#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.0)
-#> colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.0)
-#> crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0)
-#> curl 5.2.0 2023-12-08 [1] CRAN (R 4.3.0)
-#> desc 1.4.3 2023-12-10 [1] CRAN (R 4.3.0)
-#> digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.0)
-#> dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.3.0)
-#> evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.0)
-#> fansi 1.0.6 2023-12-08 [1] CRAN (R 4.3.0)
-#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0)
-#> fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.0)
-#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0)
-#> glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.0)
-#> hms 1.1.3 2023-03-21 [1] CRAN (R 4.3.0)
-#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.0)
-#> httr 1.4.7 2023-08-15 [1] CRAN (R 4.3.0)
-#> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.3.0)
-#> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.0)
-#> kableExtra 1.3.4 2021-02-20 [1] CRAN (R 4.3.0)
-#> knitr * 1.45 2023-10-30 [1] CRAN (R 4.3.0)
-#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.0)
-#> magrittr * 2.0.3 2022-03-30 [1] CRAN (R 4.3.0)
-#> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0)
-#> munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.0)
-#> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0)
-#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0)
-#> pkgdown 2.0.7 2022-12-14 [1] CRAN (R 4.3.0)
-#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0)
-#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0)
-#> ragg 1.2.7 2023-12-11 [1] CRAN (R 4.3.0)
-#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.3.0)
-#> REDCapR * 1.1.9005 2024-01-22 [1] local
-#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.0)
-#> rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.0)
-#> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0)
-#> rvest 1.0.3 2022-08-19 [1] CRAN (R 4.3.0)
-#> sass 0.4.8 2023-12-06 [1] CRAN (R 4.3.0)
-#> scales 1.3.0 2023-11-28 [1] CRAN (R 4.3.0)
-#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0)
-#> stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.0)
-#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.3.0)
-#> svglite 2.1.3 2023-12-08 [1] CRAN (R 4.3.0)
-#> systemfonts 1.0.5 2023-10-09 [1] CRAN (R 4.3.0)
-#> textshaping 0.3.7 2023-10-09 [1] CRAN (R 4.3.0)
-#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0)
-#> tidyr 1.3.0 2023-01-24 [1] CRAN (R 4.3.0)
-#> tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0)
-#> tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.3.0)
-#> utf8 1.2.4 2023-10-22 [1] CRAN (R 4.3.0)
-#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.0)
-#> viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.3.0)
-#> vroom 1.6.5 2023-12-05 [1] CRAN (R 4.3.0)
-#> webshot 0.5.5 2023-06-26 [1] CRAN (R 4.3.0)
-#> withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.0)
-#> xfun 0.41 2023-11-01 [1] CRAN (R 4.3.0)
-#> xml2 1.3.6 2023-12-04 [1] CRAN (R 4.3.0)
-#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.0)
+#> backports 1.5.0 2024-05-23 [1] CRAN (R 4.4.0)
+#> bit 4.0.5 2022-11-15 [1] CRAN (R 4.4.0)
+#> bit64 4.0.5 2020-08-30 [1] CRAN (R 4.4.0)
+#> bslib 0.7.0 2024-03-29 [1] CRAN (R 4.4.0)
+#> cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
+#> checkmate 2.3.1 2023-12-04 [1] CRAN (R 4.4.0)
+#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.4.0)
+#> colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.4.0)
+#> crayon 1.5.2 2022-09-29 [1] CRAN (R 4.4.0)
+#> curl 5.2.1 2024-03-01 [1] CRAN (R 4.4.0)
+#> desc 1.4.3 2023-12-10 [1] CRAN (R 4.4.0)
+#> digest 0.6.35 2024-03-11 [1] CRAN (R 4.4.0)
+#> dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.4.0)
+#> evaluate 0.24.0 2024-06-10 [1] CRAN (R 4.4.0)
+#> fansi 1.0.6 2023-12-08 [1] CRAN (R 4.4.0)
+#> fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.0)
+#> fs 1.6.4 2024-04-25 [1] CRAN (R 4.4.0)
+#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.4.0)
+#> glue 1.7.0 2024-01-09 [1] CRAN (R 4.4.0)
+#> hms 1.1.3 2023-03-21 [1] CRAN (R 4.4.0)
+#> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0)
+#> httr 1.4.7 2023-08-15 [1] CRAN (R 4.4.0)
+#> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.4.0)
+#> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.4.0)
+#> kableExtra 1.4.0 2024-01-24 [1] CRAN (R 4.4.0)
+#> knitr * 1.47 2024-05-29 [1] CRAN (R 4.4.0)
+#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.0)
+#> magrittr * 2.0.3 2022-03-30 [1] CRAN (R 4.4.0)
+#> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.4.0)
+#> munsell 0.5.1 2024-04-01 [1] CRAN (R 4.4.0)
+#> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.4.0)
+#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.4.0)
+#> pkgdown 2.0.9 2024-04-18 [1] CRAN (R 4.4.0)
+#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.4.0)
+#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0)
+#> ragg 1.3.2 2024-05-15 [1] CRAN (R 4.4.0)
+#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
+#> REDCapR * 1.1.9005 2024-06-11 [1] local
+#> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0)
+#> rmarkdown 2.27 2024-05-17 [1] CRAN (R 4.4.0)
+#> rstudioapi 0.16.0 2024-03-24 [1] CRAN (R 4.4.0)
+#> sass 0.4.9 2024-03-15 [1] CRAN (R 4.4.0)
+#> scales 1.3.0 2023-11-28 [1] CRAN (R 4.4.0)
+#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.4.0)
+#> stringi 1.8.4 2024-05-06 [1] CRAN (R 4.4.0)
+#> 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)
+#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
+#> tidyr 1.3.1 2024-01-24 [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)
+#> utf8 1.2.4 2023-10-22 [1] CRAN (R 4.4.0)
+#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.4.0)
+#> viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.4.0)
+#> vroom 1.6.5 2023-12-05 [1] CRAN (R 4.4.0)
+#> withr 3.0.0 2024-01-16 [1] CRAN (R 4.4.0)
+#> xfun 0.44 2024-05-15 [1] CRAN (R 4.4.0)
+#> xml2 1.3.6 2023-12-04 [1] CRAN (R 4.4.0)
+#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.4.0)
#>
#> [1] /Users/runner/work/_temp/Library
-#> [2] /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
+#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
Session Information
-
Getting Started
diff --git a/articles/longitudinal-and-repeating.html b/articles/longitudinal-and-repeating.html
index 02f05966..60ccba03 100644
--- a/articles/longitudinal-and-repeating.html
+++ b/articles/longitudinal-and-repeating.html
@@ -12,7 +12,7 @@
-
+
@@ -174,27 +174,27 @@ Table 1: patient grainThis patient-grain structure is how the data points are most
comfortably inputted by humans into REDCap, and it is the default when
exported through the browser and API. However it is stored differently
-under the hood.
REDCap’s flexibility is a driver of its success. Once a research team
-learns REDCap, it can reuse the knowledge to capture anything from qqq
-to qqq. But to achieve this flexibility in the world of REDCap and EMRs,
-data are stored along the observation grain. In computer science, this
-is commonly called an EAV structure (which stands for
-entity-attribute-value). The patient’s ID is the entity, the variable
-type is the attribute, and the observed point is the value. It can also
-be thought of as a “key-value store” nested within a patient (where
-“key” is a synonym of “attribute”). Notice that the two wider rows have
-morphed into six skinnier rows –one row per observation. If you are a
-curious database administrator, peek at the the structure and rows of
-the redcap_data
table. It is the most important table in
-the database.
redcap_data
table. It is the most important
+table in the database.
intake
instrument
REDCap and EMR databases have an “observation” t, store observations
-in their underlying table. This table is a simplification of the
-redcap_data
table, which is the heart of the database.
REDCap and EMR databases store observations in their underlying
+table. This table is a simplification of the redcap_data
+table, which is the heart of the REDCap’s internal database.
pt id |
@@ -235,11 +235,11 @@
---|
If the investigation gains a longitudinal or repeating component, it -becomes necessary to include the dimension of time. Suppose the -protocols specifies five time points; the blood pressure instrument is -captured at times 1, 2, & 3 while the laboratory instrument is -captured at times 1 & 2. If you record this stage on paper, it will -likely resemble Tables 3a & 3b: one for vitals and one for labs.
+becomes necessary to include the dimension of time. Suppose the protocol +specifies five time points; the blood pressure instrument is captured at +times 1, 2, & 3 while the laboratory instrument is captured at times +1 & 2. If you record this stage on paper, it will likely resemble +Tables 3a & 3b: one for vitals and one for labs.blood_pressure
@@ -755,7 +755,9 @@ Note that the efficiency gain from moving from the block dataset to -REDCapTidieR is different than the gain from moving from REDCapTidieR. -When moving to from Table 5 to qqq (via REDCapTidieR), you are -eliminating empty cells that will never contain worthwhile data. When -moving to REDCapR, you are eliminating cells that contain data, but may -not be relevant to your analysis (such as a patient’s name or the time a -lab specimen was collected). {This paragraph needs work.}
+REDCapTidieR is different than the gain from moving from REDCapTidieR to +REDCapR. When moving to from Table 5 to a REDCapTidieR +Supertibble, you are eliminating empty cells that will never contain +worthwhile data. When moving from a REDCapTidieR Supertibble call to a +collection of REDCapR calls, you are eliminating cells that contain +data, but may not be relevant to your analysis (such as a patient’s name +or the time a lab specimen was collected). {This paragraph needs +work.}#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
-#> version R version 4.3.2 (2023-10-31)
-#> os macOS Monterey 12.7.2
-#> system x86_64, darwin20
+#> version R version 4.4.0 (2024-04-24)
+#> os macOS Sonoma 14.5
+#> system aarch64, darwin20
#> ui X11
#> language en
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz UTC
-#> date 2024-01-22
-#> pandoc 2.19.2 @ /usr/local/bin/ (via rmarkdown)
+#> date 2024-06-11
+#> pandoc 3.1.11 @ /usr/local/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
-#> backports 1.4.1 2021-12-13 [1] CRAN (R 4.3.0)
-#> bit 4.0.5 2022-11-15 [1] CRAN (R 4.3.0)
-#> bit64 4.0.5 2020-08-30 [1] CRAN (R 4.3.0)
-#> bslib 0.6.1 2023-11-28 [1] CRAN (R 4.3.0)
-#> cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0)
-#> checkmate 2.3.1 2023-12-04 [1] CRAN (R 4.3.0)
-#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.0)
-#> colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.0)
-#> crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0)
-#> curl 5.2.0 2023-12-08 [1] CRAN (R 4.3.0)
-#> desc 1.4.3 2023-12-10 [1] CRAN (R 4.3.0)
-#> digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.0)
-#> dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.3.0)
-#> evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.0)
-#> fansi 1.0.6 2023-12-08 [1] CRAN (R 4.3.0)
-#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0)
-#> fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.0)
-#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0)
-#> glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.0)
-#> hms 1.1.3 2023-03-21 [1] CRAN (R 4.3.0)
-#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.0)
-#> httr 1.4.7 2023-08-15 [1] CRAN (R 4.3.0)
-#> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.3.0)
-#> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.0)
-#> kableExtra 1.3.4 2021-02-20 [1] CRAN (R 4.3.0)
-#> knitr * 1.45 2023-10-30 [1] CRAN (R 4.3.0)
-#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.0)
-#> magrittr * 2.0.3 2022-03-30 [1] CRAN (R 4.3.0)
-#> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0)
-#> munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.0)
-#> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0)
-#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0)
-#> pkgdown 2.0.7 2022-12-14 [1] CRAN (R 4.3.0)
-#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0)
-#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0)
-#> ragg 1.2.7 2023-12-11 [1] CRAN (R 4.3.0)
-#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.3.0)
-#> REDCapR 1.1.9005 2024-01-22 [1] local
-#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.0)
-#> rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.0)
-#> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0)
-#> rvest 1.0.3 2022-08-19 [1] CRAN (R 4.3.0)
-#> sass 0.4.8 2023-12-06 [1] CRAN (R 4.3.0)
-#> scales 1.3.0 2023-11-28 [1] CRAN (R 4.3.0)
-#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0)
-#> stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.0)
-#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.3.0)
-#> svglite 2.1.3 2023-12-08 [1] CRAN (R 4.3.0)
-#> systemfonts 1.0.5 2023-10-09 [1] CRAN (R 4.3.0)
-#> textshaping 0.3.7 2023-10-09 [1] CRAN (R 4.3.0)
-#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0)
-#> tidyr 1.3.0 2023-01-24 [1] CRAN (R 4.3.0)
-#> tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0)
-#> tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.3.0)
-#> utf8 1.2.4 2023-10-22 [1] CRAN (R 4.3.0)
-#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.0)
-#> viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.3.0)
-#> vroom 1.6.5 2023-12-05 [1] CRAN (R 4.3.0)
-#> webshot 0.5.5 2023-06-26 [1] CRAN (R 4.3.0)
-#> withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.0)
-#> xfun 0.41 2023-11-01 [1] CRAN (R 4.3.0)
-#> xml2 1.3.6 2023-12-04 [1] CRAN (R 4.3.0)
-#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.0)
+#> backports 1.5.0 2024-05-23 [1] CRAN (R 4.4.0)
+#> bit 4.0.5 2022-11-15 [1] CRAN (R 4.4.0)
+#> bit64 4.0.5 2020-08-30 [1] CRAN (R 4.4.0)
+#> bslib 0.7.0 2024-03-29 [1] CRAN (R 4.4.0)
+#> cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
+#> checkmate 2.3.1 2023-12-04 [1] CRAN (R 4.4.0)
+#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.4.0)
+#> colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.4.0)
+#> crayon 1.5.2 2022-09-29 [1] CRAN (R 4.4.0)
+#> curl 5.2.1 2024-03-01 [1] CRAN (R 4.4.0)
+#> desc 1.4.3 2023-12-10 [1] CRAN (R 4.4.0)
+#> digest 0.6.35 2024-03-11 [1] CRAN (R 4.4.0)
+#> dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.4.0)
+#> evaluate 0.24.0 2024-06-10 [1] CRAN (R 4.4.0)
+#> fansi 1.0.6 2023-12-08 [1] CRAN (R 4.4.0)
+#> fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.0)
+#> fs 1.6.4 2024-04-25 [1] CRAN (R 4.4.0)
+#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.4.0)
+#> glue 1.7.0 2024-01-09 [1] CRAN (R 4.4.0)
+#> hms 1.1.3 2023-03-21 [1] CRAN (R 4.4.0)
+#> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0)
+#> httr 1.4.7 2023-08-15 [1] CRAN (R 4.4.0)
+#> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.4.0)
+#> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.4.0)
+#> kableExtra 1.4.0 2024-01-24 [1] CRAN (R 4.4.0)
+#> knitr * 1.47 2024-05-29 [1] CRAN (R 4.4.0)
+#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.0)
+#> magrittr * 2.0.3 2022-03-30 [1] CRAN (R 4.4.0)
+#> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.4.0)
+#> munsell 0.5.1 2024-04-01 [1] CRAN (R 4.4.0)
+#> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.4.0)
+#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.4.0)
+#> pkgdown 2.0.9 2024-04-18 [1] CRAN (R 4.4.0)
+#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.4.0)
+#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0)
+#> ragg 1.3.2 2024-05-15 [1] CRAN (R 4.4.0)
+#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
+#> REDCapR 1.1.9005 2024-06-11 [1] local
+#> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0)
+#> rmarkdown 2.27 2024-05-17 [1] CRAN (R 4.4.0)
+#> rstudioapi 0.16.0 2024-03-24 [1] CRAN (R 4.4.0)
+#> sass 0.4.9 2024-03-15 [1] CRAN (R 4.4.0)
+#> scales 1.3.0 2023-11-28 [1] CRAN (R 4.4.0)
+#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.4.0)
+#> stringi 1.8.4 2024-05-06 [1] CRAN (R 4.4.0)
+#> 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)
+#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
+#> tidyr 1.3.1 2024-01-24 [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)
+#> utf8 1.2.4 2023-10-22 [1] CRAN (R 4.4.0)
+#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.4.0)
+#> viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.4.0)
+#> vroom 1.6.5 2023-12-05 [1] CRAN (R 4.4.0)
+#> withr 3.0.0 2024-01-16 [1] CRAN (R 4.4.0)
+#> xfun 0.44 2024-05-15 [1] CRAN (R 4.4.0)
+#> xml2 1.3.6 2023-12-04 [1] CRAN (R 4.4.0)
+#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.4.0)
#>
#> [1] /Users/runner/work/_temp/Library
-#> [2] /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
+#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
@@ -2226,7 +2228,7 @@ Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
requireNamespace("REDCapR")
-#> Loading required namespace: REDCapR
-
+#> Loading required namespace: REDCapR
+
# If this fails, run `install.packages("REDCapR")` or `remotes::install_github(repo="OuhscBbmc/REDCapR")`
If you’re a workshop attendee, you can use this vignette to copy snippets of code to your local machine to follow along with the @@ -199,7 +200,7 @@
+my_secret_token <- "9A81268476645C4E5F03428B8AC3AA7B"
Instead, we suggest storing the token in a location that can be accessed by only you. We have two recommendations.
@@ -220,7 +221,7 @@Security Method 1: Token File
To retrieve the credentials for the first project listed above, pass
the value of “153” to project_id
.
+path_credential <- system.file("misc/example.credentials", package = "REDCapR") credential <- REDCapR::retrieve_credential_local( path_credential = path_credential, @@ -265,7 +266,7 @@
Part 3 - Read Data: Unstructur
The
-redcap_uri
andtoken
fields are the only required arguments ofREDCapR::redcap_read()
; both are in the credential object created in the previous section.++#> 5 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200.ds_1 <- REDCapR::redcap_read( redcap_uri = credential$redcap_uri, @@ -275,14 +276,14 @@
Part 3 - Read Data: Unstructur #> 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.2 seconds. The http status code was 200. -#> 5 records and 1 columns were read from REDCap in 0.1 seconds. The http status code was 200. -#> Starting to read 5 records at 2024-01-22 17:12:06.381678. +#> 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-06-11 17:21:44.527724. #> 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.1 seconds. The http status code was 200.
At this point, the data.frame
-ds_1
has everything you need to start analyzing the project.++ds_1 #> # A tibble: 5 × 25 #> record_id name_first name_last address telephone email dob age sex @@ -296,11 +297,12 @@
Part 3 - Read Data: Unstructur #> # bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> # race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> # race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, -#> # race_and_ethnicity_complete <dbl> - +#> # race_and_ethnicity_complete <dbl>
-+hist(ds_1$weight)
++summary(ds_1) #> record_id name_first name_last address @@ -350,8 +352,9 @@
Part 3 - Read Data: Unstructur #> Mean :0.2 Mean :1 Mean :0.25 Mean :1.6 #> 3rd Qu.:0.0 3rd Qu.:1 3rd Qu.:0.25 3rd Qu.:2.0 #> Max. :1.0 Max. :2 Max. :1.00 Max. :2.0 -#> NA's :1 - +#> NA's :1
diff --git a/reference/index.html b/reference/index.html index ab730d13..73602367 100644 --- a/reference/index.html +++ b/reference/index.html @@ -1,5 +1,5 @@ -+summary(lm(age ~ 1 + sex + bmi, data = ds_1)) #> #> Call: @@ -403,7 +406,7 @@
Specify Record IDs
+diff --git a/reference/create_batch_glossary.html b/reference/create_batch_glossary.html index 52603806..490dc9b1 100644 --- a/reference/create_batch_glossary.html +++ b/reference/create_batch_glossary.html @@ -1,7 +1,5 @@ -# Return only records with IDs of 1 and 4 desired_records <- c(1, 4) REDCapR::redcap_read( @@ -431,7 +434,7 @@
Specify Row Filter
+# Return only records with a birth date after January 2003 REDCapR::redcap_read( redcap_uri = credential$redcap_uri, @@ -455,7 +458,7 @@
Specify Column Names
+diff --git a/reference/constant.html b/reference/constant.html index d5c8a9ac..8411f8f4 100644 --- a/reference/constant.html +++ b/reference/constant.html @@ -1,5 +1,5 @@ -# Return only the fields record_id, name_first, and age desired_fields <- c("record_id", "name_first", "age") REDCapR::redcap_read( @@ -497,7 +500,7 @@
Part 5 - Read Data: Structured A
Specify Column Names & Types
-diff --git a/pkgdown.yml b/pkgdown.yml index c317c40e..878c5174 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -1,15 +1,15 @@ -pandoc: 2.19.2 -pkgdown: 2.0.7 +pandoc: 3.1.11 +pkgdown: 2.0.9 pkgdown_sha: ~ articles: + advanced-redcapr-operations: advanced-redcapr-operations.html BasicREDCapROperations: BasicREDCapROperations.html + longitudinal-and-repeating: longitudinal-and-repeating.html SecurityDatabase: SecurityDatabase.html TroubleshootingApiCalls: TroubleshootingApiCalls.html - advanced-redcapr-operations: advanced-redcapr-operations.html - longitudinal-and-repeating: longitudinal-and-repeating.html workflow-read: workflow-read.html workflow-write: workflow-write.html -last_built: 2024-01-22T17:10Z +last_built: 2024-06-11T17:20Z urls: reference: https://ouhscbbmc.github.io/REDCapR/reference article: https://ouhscbbmc.github.io/REDCapR/articles diff --git a/reference/REDCapR-package.html b/reference/REDCapR-package.html index 576e6d9e..1dcab2aa 100644 --- a/reference/REDCapR-package.html +++ b/reference/REDCapR-package.html @@ -1,7 +1,7 @@ -+# Specify the column types. desired_fields <- c("record_id", "race") col_types <- readr::cols( @@ -531,7 +534,7 @@
andSpecify Everything is a CharacterREDCap internally stores every value as a string. To accept full responsibility of the data types, tell
readr::cols()
to keep them as strings. -diff --git a/authors.html b/authors.html index cb36ac5a..01db9bbf 100644 --- a/authors.html +++ b/authors.html @@ -1,5 +1,5 @@ -+diff --git a/articles/workflow-write.html b/articles/workflow-write.html index dd7b4235..f3c80c30 100644 --- a/articles/workflow-write.html +++ b/articles/workflow-write.html @@ -12,7 +12,7 @@ - + @@ -446,54 +446,51 @@# Specify the column types. desired_fields <- c("record_id", "race") col_types <- readr::cols(.default = readr::col_character()) @@ -624,75 +627,73 @@
Session Information
@@ -716,7 +717,7 @@#> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value -#> version R version 4.3.2 (2023-10-31) -#> os macOS Monterey 12.7.2 -#> system x86_64, darwin20 +#> version R version 4.4.0 (2024-04-24) +#> os macOS Sonoma 14.5 +#> system aarch64, darwin20 #> ui X11 #> language en #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz UTC -#> date 2024-01-22 -#> pandoc 2.19.2 @ /usr/local/bin/ (via rmarkdown) +#> date 2024-06-11 +#> pandoc 3.1.11 @ /usr/local/bin/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source -#> backports 1.4.1 2021-12-13 [1] CRAN (R 4.3.0) -#> bit 4.0.5 2022-11-15 [1] CRAN (R 4.3.0) -#> bit64 4.0.5 2020-08-30 [1] CRAN (R 4.3.0) -#> bslib 0.6.1 2023-11-28 [1] CRAN (R 4.3.0) -#> cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0) -#> checkmate 2.3.1 2023-12-04 [1] CRAN (R 4.3.0) -#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.0) -#> crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0) -#> curl 5.2.0 2023-12-08 [1] CRAN (R 4.3.0) -#> desc 1.4.3 2023-12-10 [1] CRAN (R 4.3.0) -#> digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.0) -#> dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.3.0) -#> evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.0) -#> fansi 1.0.6 2023-12-08 [1] CRAN (R 4.3.0) -#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) -#> fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.0) -#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0) -#> glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.0) -#> highr 0.10 2022-12-22 [1] CRAN (R 4.3.0) -#> hms 1.1.3 2023-03-21 [1] CRAN (R 4.3.0) -#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.0) -#> httr 1.4.7 2023-08-15 [1] CRAN (R 4.3.0) -#> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.3.0) -#> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.0) -#> knitr 1.45 2023-10-30 [1] CRAN (R 4.3.0) -#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.0) -#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) -#> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) -#> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0) -#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0) -#> pkgdown 2.0.7 2022-12-14 [1] CRAN (R 4.3.0) -#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0) -#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) -#> ragg 1.2.7 2023-12-11 [1] CRAN (R 4.3.0) -#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.3.0) -#> REDCapR 1.1.9005 2024-01-22 [1] local -#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.0) -#> rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.0) -#> sass 0.4.8 2023-12-06 [1] CRAN (R 4.3.0) -#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) -#> stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.0) -#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.3.0) -#> systemfonts 1.0.5 2023-10-09 [1] CRAN (R 4.3.0) -#> textshaping 0.3.7 2023-10-09 [1] CRAN (R 4.3.0) -#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0) -#> tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0) -#> tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.3.0) -#> utf8 1.2.4 2023-10-22 [1] CRAN (R 4.3.0) -#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.0) -#> vroom 1.6.5 2023-12-05 [1] CRAN (R 4.3.0) -#> withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.0) -#> xfun 0.41 2023-11-01 [1] CRAN (R 4.3.0) -#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.0) +#> backports 1.5.0 2024-05-23 [1] CRAN (R 4.4.0) +#> bit 4.0.5 2022-11-15 [1] CRAN (R 4.4.0) +#> bit64 4.0.5 2020-08-30 [1] CRAN (R 4.4.0) +#> bslib 0.7.0 2024-03-29 [1] CRAN (R 4.4.0) +#> cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0) +#> checkmate 2.3.1 2023-12-04 [1] CRAN (R 4.4.0) +#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.4.0) +#> crayon 1.5.2 2022-09-29 [1] CRAN (R 4.4.0) +#> curl 5.2.1 2024-03-01 [1] CRAN (R 4.4.0) +#> desc 1.4.3 2023-12-10 [1] CRAN (R 4.4.0) +#> digest 0.6.35 2024-03-11 [1] CRAN (R 4.4.0) +#> dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.4.0) +#> evaluate 0.24.0 2024-06-10 [1] CRAN (R 4.4.0) +#> fansi 1.0.6 2023-12-08 [1] CRAN (R 4.4.0) +#> fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.0) +#> fs 1.6.4 2024-04-25 [1] CRAN (R 4.4.0) +#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.4.0) +#> glue 1.7.0 2024-01-09 [1] CRAN (R 4.4.0) +#> highr 0.11 2024-05-26 [1] CRAN (R 4.4.0) +#> hms 1.1.3 2023-03-21 [1] CRAN (R 4.4.0) +#> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0) +#> httr 1.4.7 2023-08-15 [1] CRAN (R 4.4.0) +#> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.4.0) +#> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.4.0) +#> knitr 1.47 2024-05-29 [1] CRAN (R 4.4.0) +#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.0) +#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.4.0) +#> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.4.0) +#> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.4.0) +#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.4.0) +#> pkgdown 2.0.9 2024-04-18 [1] CRAN (R 4.4.0) +#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.4.0) +#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0) +#> ragg 1.3.2 2024-05-15 [1] CRAN (R 4.4.0) +#> readr 2.1.5 2024-01-10 [1] CRAN (R 4.4.0) +#> REDCapR 1.1.9005 2024-06-11 [1] local +#> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0) +#> rmarkdown 2.27 2024-05-17 [1] CRAN (R 4.4.0) +#> sass 0.4.9 2024-03-15 [1] CRAN (R 4.4.0) +#> sessioninfo 1.2.2 2021-12-06 [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) +#> 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) +#> utf8 1.2.4 2023-10-22 [1] CRAN (R 4.4.0) +#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.4.0) +#> vroom 1.6.5 2023-12-05 [1] CRAN (R 4.4.0) +#> withr 3.0.0 2024-01-16 [1] CRAN (R 4.4.0) +#> xfun 0.44 2024-05-15 [1] CRAN (R 4.4.0) +#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.4.0) #> #> [1] /Users/runner/work/_temp/Library -#> [2] /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library +#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #> #> ──────────────────────────────────────────────────────────────────────────────
Session Information -
Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
Session Information
@@ -517,7 +514,7 @@#> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value -#> version R version 4.3.2 (2023-10-31) -#> os macOS Monterey 12.7.2 -#> system x86_64, darwin20 +#> version R version 4.4.0 (2024-04-24) +#> os macOS Sonoma 14.5 +#> system aarch64, darwin20 #> ui X11 #> language en #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz UTC -#> date 2024-01-22 -#> pandoc 2.19.2 @ /usr/local/bin/ (via rmarkdown) +#> date 2024-06-11 +#> pandoc 3.1.11 @ /usr/local/bin/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source -#> bslib 0.6.1 2023-11-28 [1] CRAN (R 4.3.0) -#> cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0) -#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.0) -#> desc 1.4.3 2023-12-10 [1] CRAN (R 4.3.0) -#> digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.0) -#> evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.0) -#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) -#> fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.0) -#> glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.0) -#> highr 0.10 2022-12-22 [1] CRAN (R 4.3.0) -#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.0) -#> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.3.0) -#> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.0) -#> knitr 1.45 2023-10-30 [1] CRAN (R 4.3.0) -#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.0) -#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) -#> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) -#> pkgdown 2.0.7 2022-12-14 [1] CRAN (R 4.3.0) -#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0) -#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) -#> ragg 1.2.7 2023-12-11 [1] CRAN (R 4.3.0) -#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.0) -#> rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.0) -#> sass 0.4.8 2023-12-06 [1] CRAN (R 4.3.0) -#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) -#> stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.0) -#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.3.0) -#> systemfonts 1.0.5 2023-10-09 [1] CRAN (R 4.3.0) -#> textshaping 0.3.7 2023-10-09 [1] CRAN (R 4.3.0) -#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.0) -#> xfun 0.41 2023-11-01 [1] CRAN (R 4.3.0) -#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.0) +#> bslib 0.7.0 2024-03-29 [1] CRAN (R 4.4.0) +#> cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0) +#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.4.0) +#> desc 1.4.3 2023-12-10 [1] CRAN (R 4.4.0) +#> digest 0.6.35 2024-03-11 [1] CRAN (R 4.4.0) +#> evaluate 0.24.0 2024-06-10 [1] CRAN (R 4.4.0) +#> fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.0) +#> fs 1.6.4 2024-04-25 [1] CRAN (R 4.4.0) +#> highr 0.11 2024-05-26 [1] CRAN (R 4.4.0) +#> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0) +#> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.4.0) +#> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.4.0) +#> knitr 1.47 2024-05-29 [1] CRAN (R 4.4.0) +#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.0) +#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.4.0) +#> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.4.0) +#> pkgdown 2.0.9 2024-04-18 [1] CRAN (R 4.4.0) +#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.4.0) +#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0) +#> ragg 1.3.2 2024-05-15 [1] CRAN (R 4.4.0) +#> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0) +#> rmarkdown 2.27 2024-05-17 [1] CRAN (R 4.4.0) +#> sass 0.4.9 2024-03-15 [1] CRAN (R 4.4.0) +#> sessioninfo 1.2.2 2021-12-06 [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) +#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.4.0) +#> xfun 0.44 2024-05-15 [1] CRAN (R 4.4.0) +#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.4.0) #> #> [1] /Users/runner/work/_temp/Library -#> [2] /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library +#> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #> #> ──────────────────────────────────────────────────────────────────────────────
Session Information -
Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
Authors and Citation • REDCapR Authors and Citation • REDCapR @@ -52,7 +52,7 @@ diff --git a/index.html b/index.html index cd70b25b..265fdf18 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@ - + @@ -20,12 +20,7 @@ - +Changelog • REDCapR Changelog • REDCapR @@ -92,6 +92,7 @@Possibly Breaking Changeredcap_read()
redcap_read_oneshot()
now return an empty dataset if no records are retrieved (such as no records meet the filter criteria). Currently a 0x0 tibble is returned, but that may change in the future. Until now an error was deliberately thrown. (#452)+
redcap_event_instruments()
now by default returns mappings for all arms. The previous default was to return the mappings for only the first arm. To recreate the previous behavior use a call likeREDCapR::redcap_event_instruments(uri, token_2, arms = "1")
. (Suggested by @januz, #482)
redcap_users_export()
used to return a boolean foruser_rights
, but now it can be 0, 1, or 2. (#523)New Features
@@ -150,6 +151,8 @@Minor Enhancements
redcap_read()
checks theevent
parameter and throws an error if a value is not recognized, or the project is not longitudinal (#493)The regex in +regex_named_captures()
is forgiving if there’s an unnecessary leading space (@BlairCooper, #495, #501)+ redcap_log_read()
assumes all columns are character, except fortimestamp
(#525)R utilities for interacting with a REDCap data system -https://www.project-redcap.org/ — REDCapR-package • REDCapR REDCapR: Interaction Between R and REDCap — REDCapR-package • REDCapR diff --git a/reference/collapse_vector.html b/reference/collapse_vector.html index 018ee408..ce8a43fd 100644 --- a/reference/collapse_vector.html +++ b/reference/collapse_vector.html @@ -1,5 +1,5 @@ --R utilities for interacting with a REDCap data system -https://www.project-redcap.org/
+REDCapR: Interaction Between R and REDCap
Source:R/REDCapR-package.R
REDCapR-package.Rd
-+Comprehensive documentation is also available at +
+Encapsulates functions to streamline calls from R to the REDCap API. REDCap (Research Electronic Data CAPture) is a web application for building and managing online surveys and databases developed at Vanderbilt University. The Application Programming Interface (API) offers an avenue to access and modify data programmatically, improving the capacity for literate and reproducible programming.
+Comprehensive documentation is also available at https://ouhscbbmc.github.io/REDCapR/.
Much of this package has been developed to support the needs of the following projects. We appreciate the support.
OUHSC CCAN Independent Evaluation of the State of Oklahoma Competitive @@ -136,6 +137,35 @@
Note
See REDCapR's advanced vignette for information and examples for overriding the default SSL options.
++See also
+ +Examples
@@ -162,7 +192,7 @@Examples
Collapse a vector of values into a single string when necessary — collapse_vector • REDCapR Collapse a vector of values into a single string when necessary — collapse_vector • REDCapR -Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
Collection of REDCap-specific constants — constant • REDCapR Collection of REDCap-specific constants — constant • REDCapR @@ -192,7 +192,7 @@Examples
Creates a dataset that help batching long-running -read and writes — create_batch_glossary • REDCapR Creates a dataset that help batching long-running read and writes — create_batch_glossary • REDCapR -@@ -183,7 +180,7 @@Creates a dataset that help batching long-running -read and writes
+Creates a dataset that help batching long-running read and writes
Source:R/create-batch-glossary.R
create_batch_glossary.Rd
Examples
Function reference • REDCapR Function reference • REDCapR @@ -61,8 +61,7 @@Records via the API
- + Read records from a REDCap project in subsets, and stacks them -together before returning a dataset
Read records from a REDCap project in subsets, and stacks them together before returning a dataset
@@ -172,10 +171,9 @@ Internals
Functions and classes used by the methods above.
- + -+ R utilities for interacting with a REDCap data system -https://www.project-redcap.org/
REDCapR: Interaction Between R and REDCap
@@ -195,8 +193,7 @@ Security
-
retrieve_credential_local()
retrieve_credential_mssql()
create_credential_local()
+ Read a token and other credentials from a (non-REDCap) -database or file
Read a token and other credentials from a (non-REDCap) database or file
Utilities
Functions to help the methods above.
@@ -212,8 +209,7 @@Utilities create_batch_glossary() -
+ Creates a dataset that help batching long-running -read and writes
Creates a dataset that help batching long-running read and writes
@@ -233,8 +229,7 @@ Utilities validate_for_write()
validate_data_frame_inherits()
validate_no_logical()
validate_field_names()
validate_record_id_name()
validate_repeat_instance()
validate_uniqueness()
-+ Inspect a dataset to anticipate problems before -writing to a REDCap project
Inspect a dataset to anticipate problems before writing to a REDCap project
Soft Deprecated
Functions that have been renamed and will be removed in future REDCapR versions.
@@ -264,7 +259,7 @@Soft Deprecated -
diff --git a/reference/redcap_event_read.html b/reference/redcap_event_read.html index 751443a5..8a2278b1 100644 --- a/reference/redcap_event_read.html +++ b/reference/redcap_event_read.html @@ -1,5 +1,5 @@ -Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
diff --git a/reference/kernel_api.html b/reference/kernel_api.html index 46bb12b4..31dcfe40 100644 --- a/reference/kernel_api.html +++ b/reference/kernel_api.html @@ -1,5 +1,5 @@ -REDCapR internal function for calling the REDCap API — kernel_api • REDCapR REDCapR internal function for calling the REDCap API — kernel_api • REDCapR @@ -146,7 +146,7 @@Examples
# Consume the results in a few different ways. kernel$result #> Response [https://bbmc.ouhsc.edu/redcap/api/] -#> Date: 2024-01-22 17:10 +#> Date: 2024-06-11 17:20 #> Status: 200 #> Content-Type: text/csv; charset=utf-8 #> Size: 717 B @@ -267,7 +267,7 @@Examples
diff --git a/reference/metadata_utilities.html b/reference/metadata_utilities.html index 9079b973..5189f2e8 100644 --- a/reference/metadata_utilities.html +++ b/reference/metadata_utilities.html @@ -1,5 +1,5 @@ -Manipulate and interpret the metadata of a REDCap project — metadata_utilities • REDCapR Manipulate and interpret the metadata of a REDCap project — metadata_utilities • REDCapR Export Arms — redcap_arm_export • REDCapR Export Arms — redcap_arm_export • REDCapR @@ -147,7 +147,7 @@Examples
# Query a classic project with 3 arms token_1 <- "CDF9F3767E413FDBAA31D92E9F36730A" result_1 <- REDCapR::redcap_arm_export(redcap_uri=uri, token=token_1) -#> The list of arms was retrieved from the REDCap project in 0.1 seconds. The http status code was 200. +#> The list of arms was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. result_1$has_arms #> [1] TRUE result_1$data @@ -161,7 +161,7 @@Examples
# Query a classic project without arms token_2 <- "D70F9ACD1EDD6F151C6EA78683944E98" result_2 <- REDCapR::redcap_arm_export(redcap_uri=uri, token=token_2) -#> A 'classic' REDCap project has no arms. Retrieved in 0.1 seconds. The http status code was 400. +#> A 'classic' REDCap project has no arms. Retrieved in 0.2 seconds. The http status code was 400. result_2$has_arms #> [1] FALSE result_2$data @@ -182,7 +182,7 @@Examples
diff --git a/reference/redcap_column_sanitize.html b/reference/redcap_column_sanitize.html index 71dec533..5b39c6bb 100644 --- a/reference/redcap_column_sanitize.html +++ b/reference/redcap_column_sanitize.html @@ -1,5 +1,5 @@ -Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize • REDCapR Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize • REDCapR Read data access groups from a REDCap project — redcap_dag_read • REDCapR Read data access groups from a REDCap project — redcap_dag_read • REDCapR Delete records in a REDCap project — redcap_delete • REDCapR Delete records in a REDCap project — redcap_delete • REDCapR @@ -197,7 +197,7 @@Examples
diff --git a/reference/redcap_event_instruments.html b/reference/redcap_event_instruments.html index 63d96c00..c6c5580b 100644 --- a/reference/redcap_event_instruments.html +++ b/reference/redcap_event_instruments.html @@ -1,5 +1,5 @@ -Enumerate the instruments to event mappings — redcap_event_instruments • REDCapR ExamplesExport Events — redcap_event_read • REDCapR Export Events — redcap_event_read • REDCapR @@ -199,7 +199,7 @@Examples
diff --git a/reference/redcap_file_download_oneshot.html b/reference/redcap_file_download_oneshot.html index bcb61f62..9288148c 100644 --- a/reference/redcap_file_download_oneshot.html +++ b/reference/redcap_file_download_oneshot.html @@ -1,5 +1,5 @@ -Download a file from a REDCap project record — redcap_file_download_oneshot • REDCapR Download a file from a REDCap project record — redcap_file_download_oneshot • REDCapR @@ -216,7 +216,7 @@Examples
base::unlink("mugshot-1.jpg") (full_name <- base::tempfile(pattern="mugshot", fileext = ".jpg")) -#> [1] "/var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/mugshot8807454e3a7.jpg" +#> [1] "/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/mugshot15c370b4bcc5.jpg" result_2 <- REDCapR::redcap_file_download_oneshot( file_name = full_name, record = record, @@ -224,8 +224,8 @@Examples
redcap_uri = uri, token = token ) -#> Preparing to download the file `/var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/mugshot8807454e3a7.jpg`. -#> image/jpeg; name="mugshot-1.jpg" successfully downloaded in 0.1 seconds, and saved as /var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/mugshot8807454e3a7.jpg. +#> Preparing to download the file `/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/mugshot15c370b4bcc5.jpg`. +#> image/jpeg; name="mugshot-1.jpg" successfully downloaded in 0.1 seconds, and saved as /var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/mugshot15c370b4bcc5.jpg. base::unlink(full_name) (relative_name <- "ssss.jpg") @@ -255,7 +255,7 @@Examples
diff --git a/reference/redcap_file_upload_oneshot.html b/reference/redcap_file_upload_oneshot.html index 87d31824..479dae05 100644 --- a/reference/redcap_file_upload_oneshot.html +++ b/reference/redcap_file_upload_oneshot.html @@ -1,5 +1,5 @@ -Upload a file into to a REDCap project record — redcap_file_upload_oneshot • REDCapR Upload a file into to a REDCap project record — redcap_file_upload_oneshot • REDCapR @@ -222,7 +222,7 @@Examples
diff --git a/reference/redcap_instrument_download.html b/reference/redcap_instrument_download.html index 938de533..2e8576e2 100644 --- a/reference/redcap_instrument_download.html +++ b/reference/redcap_instrument_download.html @@ -1,5 +1,5 @@ -Download REDCap Instruments — redcap_instrument_download • REDCapR Download REDCap Instruments — redcap_instrument_download • REDCapR @@ -201,18 +201,18 @@Examples
#> Error in eval(expr, envir, enclos): object 'full_name' not found (full_name <- base::tempfile(pattern="instruments-all-record-1-", fileext = ".pdf")) -#> [1] "/var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/instruments-all-record-1-88088e4ac6.pdf" +#> [1] "/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/instruments-all-record-1-15c35784221f.pdf" result_2 <- REDCapR::redcap_instrument_download( record = 5, file_name = full_name, redcap_uri = uri, token = token ) -#> Preparing to download the file `/var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/instruments-all-record-1-88088e4ac6.pdf`. -#> text/html; charset=UTF-8 successfully downloaded in 0.2 seconds, and saved as /var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/instruments-all-record-1-88088e4ac6.pdf. +#> Preparing to download the file `/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/instruments-all-record-1-15c35784221f.pdf`. +#> text/html; charset=UTF-8 successfully downloaded in 0.3 seconds, and saved as /var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/instruments-all-record-1-15c35784221f.pdf. base::unlink(full_name) (full_name <- base::tempfile(pattern="instrument-1-record-1-", fileext=".pdf")) -#> [1] "/var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/instrument-1-record-1-88035cf118d.pdf" +#> [1] "/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/instrument-1-record-1-15c323dc4e1c.pdf" result_3 <- REDCapR::redcap_instrument_download( record = 5, instrument = "health", @@ -220,8 +220,8 @@Examples
redcap_uri = uri, token = token ) -#> Preparing to download the file `/var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/instrument-1-record-1-88035cf118d.pdf`. -#> text/html; charset=UTF-8 successfully downloaded in 0.2 seconds, and saved as /var/folders/mm/pltwc2yj1jx192t6dzy9zsrr0000gn/T//RtmpVSAzeS/instrument-1-record-1-88035cf118d.pdf. +#> Preparing to download the file `/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/instrument-1-record-1-15c323dc4e1c.pdf`. +#> text/html; charset=UTF-8 successfully downloaded in 0.2 seconds, and saved as /var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T//RtmpHp9whf/instrument-1-record-1-15c323dc4e1c.pdf. base::unlink(full_name) # } @@ -238,7 +238,7 @@Examples
diff --git a/reference/redcap_instruments.html b/reference/redcap_instruments.html index 1bec8895..a15c21c3 100644 --- a/reference/redcap_instruments.html +++ b/reference/redcap_instruments.html @@ -1,5 +1,5 @@ -Enumerate the instruments (forms) — redcap_instruments • REDCapR Enumerate the instruments (forms) — redcap_instruments • REDCapR -Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
diff --git a/reference/redcap_log_read.html b/reference/redcap_log_read.html index 2db4bc0e..9d808d9c 100644 --- a/reference/redcap_log_read.html +++ b/reference/redcap_log_read.html @@ -1,5 +1,5 @@ -Get the logging of a project. — redcap_log_read • REDCapR Get the logging of a project. — redcap_log_read • REDCapR Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes • REDCapR Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes • REDCapR #> race_and_ethnicity_complete = readr::col_integer() , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data -#> 5 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 5 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> # A tibble: 5 × 25 #> record_id name_first name_last address telephone email dob age sex #> <chr> <chr> <chr> <chr> <chr> <chr> <date> <chr> <chr> @@ -403,7 +403,7 @@Examples
#> completion_project_questionnaire_complete = readr::col_integer() , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data -#> 18 records and 125 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 18 records and 125 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> # A tibble: 18 × 125 #> study_id redcap_event_name date_enrolled patient_document first_name #> <chr> <chr> <date> <chr> <chr> @@ -456,7 +456,7 @@Examples
#> bp_complete = readr::col_integer() , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data -#> 9 records and 15 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 9 records and 15 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> # A tibble: 9 × 15 #> record_id redcap_repeat_instrument redcap_repeat_instance date_enrolled #> <int> <chr> <int> <date> @@ -536,7 +536,7 @@Examples
#> form_1_complete = readr::col_integer() , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data -#> 1 records and 52 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 1 records and 52 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> # A tibble: 1 × 52 #> record_id f_calculated f_checkbox___0 f_checkbox___1 f_checkbox___2 f_dropdown #> <int> <chr> <lgl> <lgl> <lgl> <chr> @@ -563,7 +563,7 @@Examples
diff --git a/reference/redcap_metadata_read.html b/reference/redcap_metadata_read.html index a2e536ab..ef6b083e 100644 --- a/reference/redcap_metadata_read.html +++ b/reference/redcap_metadata_read.html @@ -1,5 +1,5 @@ -Export the metadata of a REDCap project — redcap_metadata_read • REDCapR Export the metadata of a REDCap project — redcap_metadata_read • REDCapR Import metadata of a REDCap project — redcap_metadata_write • REDCapR Import metadata of a REDCap project — redcap_metadata_write • REDCapR Determine free available record ID — redcap_next_free_record_name • REDCapR Determine free available record ID — redcap_next_free_record_name • REDCapR @@ -125,24 +125,24 @@Note
exports the next potential record ID for a project. It generates the next record name by determining the current maximum numerical record ID and then incrementing it by one. -+: This method does not create a new record, but merely determines what - Notenext record name would be. - the -Groups (DAGs) in the project, this method accounts for - If using Data Access for users in DAGs (e.g., DAG-ID); - the special formatting of the record name in this case, it only assigns the next value for ID for all numbers inside -if a DAG has a corresponding DAG number of 223 wherein - a DAG. For example, 223-1 and 223-2 already exist, then the next record will be 223-3 - records if the API user belongs to the DAG that has DAG number 223. (The DAG number --assigned by REDCap for each DAG when the DAG is first created.) - is auto -in a DAG, the method considers all records - When generating a new record name in the entire project when determining the maximum record ID, including -in that DAG but then later - those that might have been originally created - reassigned to another DAG. -: This method functions the same even for projects that do not have - Note-numbering enabled. record auto
Note: This method does not create a new record, but merely determines what +the next record name would be. + +If using Data Access Groups (DAGs) in the project, this method accounts for +the special formatting of the record name for users in DAGs (e.g., DAG-ID); +in this case, it only assigns the next value for ID for all numbers inside +a DAG. For example, if a DAG has a corresponding DAG number of 223 wherein +records 223-1 and 223-2 already exist, then the next record will be 223-3 +if the API user belongs to the DAG that has DAG number 223. (The DAG number +is auto-assigned by REDCap for each DAG when the DAG is first created.) + +When generating a new record name in a DAG, the method considers all records +in the entire project when determining the maximum record ID, including +those that might have been originally created in that DAG but then later +reassigned to another DAG. + +Note: This method functions the same even for projects that do not have +record auto-numbering enabled.
@@ -167,7 +167,7 @@diff --git a/reference/redcap_project.html b/reference/redcap_project.html index e5903dd7..917732e1 100644 --- a/reference/redcap_project.html +++ b/reference/redcap_project.html @@ -1,5 +1,5 @@ -Examples
A Reference Class to make later calls to REDCap more convenient — redcap_project • REDCapR A Reference Class to make later calls to REDCap more convenient — redcap_project • REDCapR Export project information. — redcap_project_info_read • REDCapR Export project information. — redcap_project_info_read • REDCapR Read records from a REDCap project in subsets, and stacks them -together before returning a dataset — redcap_read • REDCapR Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read • REDCapR -@@ -314,8 +311,8 @@Read records from a REDCap project in subsets, and stacks them -together before returning a dataset
+Read records from a REDCap project in subsets, and stacks them together before returning a dataset
Source:R/redcap-read.R
redcap_read.Rd
Batching subsets of data
each batch is smaller than the entire dataset, the webserver tackles more manageably sized objects in memory. Consider batching if you encounter the error: -+: REDCap ran out of server memory. The request cannot be processed. - ERROR/exporting a smaller amount of data. Please try importing
ERROR: REDCap ran out of server memory. The request cannot be processed. +Please try importing/exporting a smaller amount of data.
A third benefit (compared to
redcap_read()
) is that important fields are included, even if not explicitly requested. As a result:
record_id
(or it's customized name) will always be returned- @@ -358,7 +355,7 @@
redcap_event_name
will be returned for longitudinal projectsPseudofields
nameddemographics_timestamp
. REDCapR does not suppress requests for timestamps, so the server will throw an error like -+: The following values in the parameter fields are not valid: 'demographics_timestamp' ERROR
diff --git a/reference/redcap_read_eav_oneshot.html b/reference/redcap_read_eav_oneshot.html index ca019d6a..912d1ce3 100644 --- a/reference/redcap_read_eav_oneshot.html +++ b/reference/redcap_read_eav_oneshot.html @@ -1,5 +1,5 @@ -Events
@@ -405,14 +402,14 @@Examples
#> 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.1 seconds. The http status code was 200. -#> Starting to read 5 records at 2024-01-22 17:10:51.976842. +#> 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-06-11 17:20:53.579703. #> Reading batch 1 of 3, with subjects 1 through 2 (ie, 2 unique subject records). -#> 2 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> Reading batch 2 of 3, with subjects 3 through 4 (ie, 2 unique subject records). -#> 2 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> Reading batch 3 of 3, with subjects 5 through 5 (ie, 1 unique subject records). -#> 1 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 1 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> # A tibble: 5 × 25 #> record_id name_first name_last address telephone email dob age sex #> <dbl> <chr> <chr> <chr> <chr> <chr> <date> <dbl> <dbl> @@ -448,14 +445,14 @@Examples
#> 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.1 seconds. The http status code was 200. -#> Starting to read 5 records at 2024-01-22 17:10:55.37869. +#> 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-06-11 17:20:56.843839. #> Reading batch 1 of 3, with subjects 1 through 2 (ie, 2 unique subject records). -#> 2 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 2 records and 25 columns were read from REDCap in 0.3 seconds. The http status code was 200. #> Reading batch 2 of 3, with subjects 3 through 4 (ie, 2 unique subject records). -#> 2 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> Reading batch 3 of 3, with subjects 5 through 5 (ie, 1 unique subject records). -#> 1 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 1 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200. #> # A tibble: 5 × 25 #> record_id name_first name_last address telephone email dob age sex #> <int> <chr> <chr> <chr> <chr> <chr> <date> <dbl> <dbl> @@ -484,7 +481,7 @@Examples
Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot • REDCapR Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot • REDCapR Read/Export records from a REDCap project — redcap_read_oneshot • REDCapR Read/Export records from a REDCap project — redcap_read_oneshot • REDCapR @@ -286,7 +286,7 @@Details
nameddemographics_timestamp
. REDCapR does not suppress requests for timestamps, so the server will throw an error like -+: The following values in the parameter fields are not valid: 'demographics_timestamp' ERROR
@@ -361,7 +361,7 @@References
@@ -310,7 +310,7 @@Examples
# Return all records and all variables. ds <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token)$data -#> 5 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 5 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200. # Return only records with IDs of 1 and 3 desired_records_v1 <- c(1, 3) @@ -319,7 +319,7 @@Examples
token = token, records = desired_records_v1 )$data -#> 2 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 2 records and 25 columns were read from REDCap in 0.2 seconds. The http status code was 200. # Return only the fields record_id, name_first, and age desired_fields_v1 <- c("record_id", "name_first", "age") @@ -328,7 +328,7 @@Examples
token = token, fields = desired_fields_v1 )$data -#> 5 records and 3 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 5 records and 3 columns were read from REDCap in 0.2 seconds. The http status code was 200. # Specify the column types. col_types <- readr::cols( @@ -345,7 +345,7 @@Examples
token = token, col_types = col_types )$data -#> 5 records and 25 columns were read from REDCap in 0.1 seconds. The http status code was 200. +#> 5 records and 25 columns were read from REDCap in 0.4 seconds. The http status code was 200. # }Examples
diff --git a/reference/redcap_read_oneshot_eav.html b/reference/redcap_read_oneshot_eav.html index b0b61bcf..918db417 100644 --- a/reference/redcap_read_oneshot_eav.html +++ b/reference/redcap_read_oneshot_eav.html @@ -1,5 +1,5 @@ -Read/Export records from a REDCap project --still in development — redcap_read_oneshot_eav • REDCapR Read/Export records from a REDCap project --still in development — redcap_read_oneshot_eav • REDCapR Read/Export records that populate a REDCap report — redcap_report • REDCapR Read/Export records that populate a REDCap report — redcap_report • REDCapR Download a file from a REDCap project record — redcap_survey_link_export_oneshot • REDCapR Download a file from a REDCap project record — redcap_survey_link_export_oneshot • REDCapR @@ -196,7 +196,7 @@Examples
diff --git a/reference/redcap_users_export.html b/reference/redcap_users_export.html index ba08e56a..94fcd215 100644 --- a/reference/redcap_users_export.html +++ b/reference/redcap_users_export.html @@ -1,5 +1,5 @@ -List authorized users — redcap_users_export • REDCapR List authorized users — redcap_users_export • REDCapR @@ -125,12 +125,12 @@Value
Note
Documentation in REDCap 8.4.0
-+for a project, - This method allows you to export the list of users - including their user privileges and also email address, first name, - and last name. -: If the user has been assigned to a user role, it will return - Note's defined privileges. the user with the role
@@ -141,18 +141,18 @@diff --git a/reference/redcap_variables.html b/reference/redcap_variables.html index dcd70ed3..2dd2b310 100644 --- a/reference/redcap_variables.html +++ b/reference/redcap_variables.html @@ -1,5 +1,5 @@ -Examples
result <- REDCapR::redcap_users_export(redcap_uri=uri, token=token) #> The REDCap users were successfully exported in 0.1 seconds. The http status code was 200. result$data_user -#> # A tibble: 2 × 32 +#> # A tibble: 2 × 33 #> username email firstname lastname expiration data_access_group #> <chr> <chr> <chr> <chr> <date> <chr> #> 1 unittestphifree wibeasley@hot… Unit Test PHI Free NA daga #> 2 wbeasleya william-beasl… Will Beasley… NA NA -#> # ℹ 26 more variables: data_access_group_id <chr>, design <lgl>, alerts <dbl>, -#> # user_rights <lgl>, data_access_groups <lgl>, reports <lgl>, +#> # ℹ 27 more variables: data_access_group_id <chr>, design <lgl>, alerts <dbl>, +#> # user_rights <int>, data_access_groups <lgl>, reports <lgl>, #> # stats_and_charts <lgl>, manage_survey_participants <lgl>, calendar <lgl>, #> # data_import_tool <lgl>, data_comparison_tool <lgl>, logging <lgl>, #> # file_repository <lgl>, data_quality_create <lgl>, #> # data_quality_execute <lgl>, api_export <lgl>, api_import <lgl>, -#> # mobile_app <lgl>, mobile_app_download_data <lgl>, record_create <lgl>, … +#> # api_modules <dbl>, mobile_app <lgl>, mobile_app_download_data <lgl>, … result$data_user_form #> # A tibble: 2 × 4 #> username form_name permission_id permission @@ -174,7 +174,7 @@Examples
Enumerate the exported variables — redcap_variables • REDCapR Enumerate the exported variables — redcap_variables • REDCapR Determine version of REDCap instance — redcap_version • REDCapR Determine version of REDCap instance — redcap_version • REDCapR @@ -126,8 +126,8 @@Examples
@@ -142,7 +142,7 @@uri <- "https://bbmc.ouhsc.edu/redcap/api/" token <- "9A81268476645C4E5F03428B8AC3AA7B" REDCapR::redcap_version(redcap_uri = uri, token = token) -#> The REDCap version was successfully determined in 0.1 seconds. The http status code was 200. Is is 13.10.3. -#> [1] ‘13.10.3’ +#> The REDCap version was successfully determined in 0.1 seconds. The http status code was 200. Is is 14.3.13. +#> [1] ‘14.3.13’
Examples
diff --git a/reference/redcap_write.html b/reference/redcap_write.html index b2852da5..f02a38c0 100644 --- a/reference/redcap_write.html +++ b/reference/redcap_write.html @@ -1,5 +1,5 @@ -Write/Import records to a REDCap project — redcap_write • REDCapR Write/Import records to a REDCap project — redcap_write • REDCapR @@ -235,7 +235,7 @@Examples
diff --git a/reference/redcap_write_oneshot.html b/reference/redcap_write_oneshot.html index c45ddb95..d7279ae4 100644 --- a/reference/redcap_write_oneshot.html +++ b/reference/redcap_write_oneshot.html @@ -1,5 +1,5 @@ -Write/Import records to a REDCap project — redcap_write_oneshot • REDCapR Write/Import records to a REDCap project — redcap_write_oneshot • REDCapR @@ -213,7 +213,7 @@Examples
diff --git a/reference/replace_nas_with_explicit.html b/reference/replace_nas_with_explicit.html index 7725d34c..0c636550 100644 --- a/reference/replace_nas_with_explicit.html +++ b/reference/replace_nas_with_explicit.html @@ -1,5 +1,5 @@ -Create explicit factor level for missing values — replace_nas_with_explicit • REDCapR Create explicit factor level for missing values — replace_nas_with_explicit • REDCapR Read a token and other credentials from a (non-REDCap) -database or file — retrieve_credential • REDCapR Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential • REDCapR Validate and sanitize the user's REDCap token — sanitize_token • REDCapR Validate and sanitize the user's REDCap token — sanitize_token • REDCapR -Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
diff --git a/reference/to_api_array.html b/reference/to_api_array.html index 948bd559..24ad652a 100644 --- a/reference/to_api_array.html +++ b/reference/to_api_array.html @@ -1,5 +1,5 @@ -Convert a vector to the array format expected by the REDCap API — to_api_array • REDCapR Convert a vector to the array format expected by the REDCap API — to_api_array • REDCapR Inspect a dataset to anticipate problems before -writing to a REDCap project — validate • REDCapR Inspect a dataset to anticipate problems before writing to a REDCap project — validate • REDCapR