keySave {kutils} | R Documentation |
Save key as file after deducing type from suffix
Description
This is specialized to saving of key objects, it is not a general purpose function for saving things. It scans the suffix of the file name and then does the right thing.
Usage
keySave(obj, file, na_ = ".", varlab)
Arguments
obj |
a variable key object |
file |
file name. must end in "csv", "xlsx" or "rds" |
na_ |
Value to insert to represent a missing score. Default ".". |
varlab |
FALSE or TRUE. Default is FALSE, no new labels will
be created. If a key object has a varlab already, it is saved
with the key, always. This parameter controls whether a new
varlab template should be created when the object is saved.
If TRUE and obj has no varlab attribute, a new varlab template
is created by the |
Details
In updates 2017-09, a varlab element was introduced. The varlab attribute of the object is saved. The files created incorporate the variable labels object in different ways. 1) XLSX: variable labels a worksheet named "varlab" 2) CSV: variable labels saved in a separate file suffixed "-varlab.csv". 3) RDS: varlab is an attribute of the key object.
Value
NULL if no file is created. Otherwise, a key object with an attribute varlab is returned.
Author(s)
Paul Johnson <pauljohn@ku.edu>