REDCapCAST/R/man/REDCap_split.Rd

54 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-06-03 22:08:26 +02:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/REDCap_split.r
\name{REDCap_split}
\alias{REDCap_split}
\title{Split REDCap repeating instruments table into multiple tables}
\usage{
REDCap_split(records, metadata)
}
\arguments{
\item{records}{Exported project records. May be a \code{data.frame} or
\code{character} vector containing JSON from an API call.}
\item{metadata}{Project metadata (the data dictionary). May be a
\code{data.frame} or \code{character} vector containing JSON from an API
call.}
}
\value{
A list of \code{"data.frame"}s: one base table and zero or more
tables for each repeating instrument.
}
\description{
This will take output from a REDCap export and split it into a base table
and child tables for each repeating instrument. Metadata
is used to determine which fields should be included in each resultant table.
}
\examples{
\dontrun{
library(RCurl)
# Get the records
records <- postForm(
uri = api_url, # Supply your site-specific URI
token = api_token, # Supply your own API token
2018-06-03 22:08:26 +02:00
content = 'record',
format = 'json',
returnFormat = 'json'
)
# Get the metadata
metadata <- postForm(
uri = api_url,
token = api_token,
content = 'metadata',
format = 'json'
)
2018-06-03 22:08:26 +02:00
# Convert exported JSON strings into a list of data.frames
REDCap_split(records, metadata)
}
}
\author{
Paul W. Egeler, M.S., GStat
}