Learn R Programming

secuTrialR (version 1.1.1)

factorize: Add factors to secuTrialdata objects

Description

secuTrial can return a codebook of codes and labels for categorical variables, including lookup type variables, if this option is selected in the export tool ('reference values as separate table'). This allows factors to be easily created. Factorize methods exist for secuTrialdata objects, data.frames, integers and logicals, but the intent is that only the former be used by users. The other methods could be used with customized codebooks.

Usage

factorize_secuTrial(object, ...)

# S3 method for secuTrialdata factorize_secuTrial(object, ...)

Value

factorized secuTrialdata object

Arguments

object

secuTrialdata object with additional factor variables in study forms containing categorical data

...

further parameters

Details

factorize_secuTrial will return an error if the appropriate codebook is not available.

Examples

Run this code
# load secuTrial export with separate reference table
sT_export <- read_secuTrial_raw(system.file("extdata", "sT_exports", "lnames",
                                            "s_export_CSV-xls_CTU05_long_ref_miss_en_utf8.zip",
                                            package = "secuTrialR"))
# factorize the secuTrialdata object
sT_export_factorized <- factorize_secuTrial(sT_export)

Run the code above in your browser using DataLab