View source: R/build_r_data_package.R
build_r_data_package | R Documentation |
Build a R Data Package from the core contents of a REDCap Project.
build_r_data_package(x, ...)
## S3 method for class 'rcer_rccore'
build_r_data_package(x, path = NULL, author_roles = NULL, verbose = TRUE, ...)
## Default S3 method:
build_r_data_package(
x,
uri = NULL,
token = NULL,
format = NULL,
path = NULL,
author_roles = NULL,
verbose = TRUE,
...
)
x |
a |
... |
arguments passed to |
path |
Path where the exported project source will be created/overwritten. |
author_roles |
a list naming specific roles for each user id found in the user table from an exported project. By default all users with be contributors ('ctb'). You will need to define a author/creator. |
verbose |
provide messages to tell the user what is happening |
uri |
The URI for the REDCap API. If |
token |
The API token for the project you want to export from. If
|
format |
The format to return. If |
To export the data from a REDCap project you will need to have an API Token. Remember, the token is the equivalent of a username and password. As such you should not list the token in plan text. Several alternative methods for passing the token to this method will be provided in examples and vignettes. We strongly encourage the use of the package secret https://cran.r-project.org/package=secret to build vaults to store tokens locally.
The initial export will consist of four pieces of data, the user data, metadata, project info, and records.
## Please read the vignette for examples:
## vignette(topic = "export", package = "REDCapExporter")
library(REDCapExporter)
# avs_raw_core <- export_core()
data(avs_raw_core)
tmppth <- tempdir()
build_r_data_package(avs_raw_core, tmppth, author_roles = list(dewittp = c("cre", "aut")))
fs::dir_tree(tmppth)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.