format_record {REDCapExporter} | R Documentation |
Format Record
Description
Use REDCap project metadata to build a well formatted data.frame
for
the record.
Usage
format_record(x, metadata = NULL, col_type = NULL, class = "data.table", ...)
Arguments
x |
a |
metadata |
a |
col_type |
a |
class |
return either a |
... |
other arguments passed to |
Value
A data.frame
or data.table
See Also
Examples
data("avs_raw_metadata")
data("avs_raw_record")
avs <- format_record(avs_raw_record, avs_raw_metadata, class = "data.frame")
avs
avs <- format_record(avs_raw_core, class = "data.frame")
head(avs)
avs <- format_record(avs_raw_core, class = "data.table")
avs$atoi
as.numeric(avs$atoi)
avs[, `:=`(atoi_seconds = as.numeric(atoi),
atoi_seconds_postseason = as.numeric(atoi_postseason),
atoi = as.character(atoi),
atoi_postseason = as.character(atoi_postseason))]
avs[, .SD, .SDcols = patterns("atoi")]
[Package REDCapExporter version 0.2.2 Index]