dd2script: Data Dictionary to R script

View source: R/datadictto.R

dd2scriptR Documentation

Data Dictionary to R script

Description

Convert data dictionary to an R script

Usage

dd2script(l, file = "", factorHandle = c("duplicate", "unchanged", "changed"))

Arguments

l

data dictionary list

file

character string naming the file to print to; defaults to standard output

factorHandle

character value of either ‘duplicated’, ‘unchanged’, ‘changed’. Determines how to handle factor variables.

Value

character vector of R commands, returned invisibly

Examples

dd <- script2info(system.file("examples", "ex_script.R", package = "rcmoonpie"))
# \sQuote{duplicate} will create new factor variable with name \sQuote{variablename.factor}
dd2script(dd)
# \sQuote{unchanged} will leave variables as character strings
dd2script(dd, factorHandle = 'unchanged')
# \sQuote{changed} will replace character string with factor variable
dd2script(dd, factorHandle = 'changed')


couthcommander/rcmoonpie documentation built on May 17, 2022, 12:35 a.m.