|
- % Generated by roxygen2 (4.0.1): do not edit by hand
- \encoding{UTF-8}
- \name{loadFormatsFromFile}
- \alias{loadFormatsFromFile}
- \title{Load formats from flat files}
- \usage{
- loadFormatsFromFile(dataframe, file_format, file_attrib)
- }
- \arguments{
- \item{dataframe}{The dataframe to which you want to assign labels}
-
- \item{file}{The flat file from which to load the label data}
- }
- \value{
- The dataframe with label attributes
- }
- \description{
- Loads factor levels from flat files and applies them to the provided dataframe
- }
- \details{
- This function takes a dataframe and assigns factor levels to the corresponding variables.
- Two files must be provided :
- One describing the formats to be used (permitting the re-use of a defined format), which must be formatted like so:
- value format_name
- value0_in_data_frame = 'Label for level 0'
- value1_in_data_frame = "Label for level 1"
- and so on.
- As shown, both single and double quotes are accepted.
- The value before the equal sign can be numeric (categorical coding) or text for recoding.
- The other file assigns defined formats to variables in the dataframe. It must be formatted like so:
- var1 var2 var3 varN format=format_name
- with one line for every assigned format.
- As always, be careful of the case sensitiveness.
- }
- \examples{
- \dontrun{df <- loadFormatsFromFile(df,"formats.txt","attribformats.txt")}
- }
|