mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2024-11-22 13:30:23 +01:00
Fixing variable names in R package example.
This commit is contained in:
parent
50e0496d8c
commit
2cf5c8e019
@ -14,23 +14,23 @@
|
|||||||
#' \dontrun{
|
#' \dontrun{
|
||||||
#' library(RCurl)
|
#' library(RCurl)
|
||||||
#'
|
#'
|
||||||
#' # Get the metadata
|
|
||||||
#' result.meta <- postForm(
|
|
||||||
#' api_url,
|
|
||||||
#' token = api_token,
|
|
||||||
#' content = 'metadata',
|
|
||||||
#' format = 'json'
|
|
||||||
#' )
|
|
||||||
#'
|
|
||||||
#' # Get the records
|
#' # Get the records
|
||||||
#' result.record <- postForm(
|
#' records <- postForm(
|
||||||
#' uri = api_url,
|
#' uri = api_url, # Supply your site-specific URI
|
||||||
#' token = api_token,
|
#' token = api_token, # Supply your own API token
|
||||||
#' content = 'record',
|
#' content = 'record',
|
||||||
#' format = 'json',
|
#' format = 'json',
|
||||||
#' returnFormat = 'json'
|
#' returnFormat = 'json'
|
||||||
#' )
|
#' )
|
||||||
#'
|
#'
|
||||||
|
#' # Get the metadata
|
||||||
|
#' metadata <- postForm(
|
||||||
|
#' uri = api_url,
|
||||||
|
#' token = api_token,
|
||||||
|
#' content = 'metadata',
|
||||||
|
#' format = 'json'
|
||||||
|
#' )
|
||||||
|
#'
|
||||||
#' # Convert exported JSON strings into a list of data.frames
|
#' # Convert exported JSON strings into a list of data.frames
|
||||||
#' REDCap_split(records, metadata)
|
#' REDCap_split(records, metadata)
|
||||||
#' }
|
#' }
|
||||||
|
@ -27,23 +27,23 @@ is used to determine which fields should be included in each resultant table.
|
|||||||
\dontrun{
|
\dontrun{
|
||||||
library(RCurl)
|
library(RCurl)
|
||||||
|
|
||||||
# Get the metadata
|
|
||||||
result.meta <- postForm(
|
|
||||||
api_url,
|
|
||||||
token = api_token,
|
|
||||||
content = 'metadata',
|
|
||||||
format = 'json'
|
|
||||||
)
|
|
||||||
|
|
||||||
# Get the records
|
# Get the records
|
||||||
result.record <- postForm(
|
records <- postForm(
|
||||||
uri = api_url,
|
uri = api_url, # Supply your site-specific URI
|
||||||
token = api_token,
|
token = api_token, # Supply your own API token
|
||||||
content = 'record',
|
content = 'record',
|
||||||
format = 'json',
|
format = 'json',
|
||||||
returnFormat = 'json'
|
returnFormat = 'json'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Get the metadata
|
||||||
|
metadata <- postForm(
|
||||||
|
uri = api_url,
|
||||||
|
token = api_token,
|
||||||
|
content = 'metadata',
|
||||||
|
format = 'json'
|
||||||
|
)
|
||||||
|
|
||||||
# Convert exported JSON strings into a list of data.frames
|
# Convert exported JSON strings into a list of data.frames
|
||||||
REDCap_split(records, metadata)
|
REDCap_split(records, metadata)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user