You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3KB

  1. % Generated by roxygen2 (4.0.1): do not edit by hand
  2. \encoding{UTF-8}
  3. \name{loadFormatsFromFile}
  4. \alias{loadFormatsFromFile}
  5. \title{Load formats from flat files}
  6. \usage{
  7. loadFormatsFromFile(dataframe, file_format, file_attrib)
  8. }
  9. \arguments{
  10. \item{dataframe}{The dataframe to which you want to assign labels}
  11. \item{file}{The flat file from which to load the label data}
  12. }
  13. \value{
  14. The dataframe with label attributes
  15. }
  16. \description{
  17. Loads factor levels from flat files and applies them to the provided dataframe
  18. }
  19. \details{
  20. This function takes a dataframe and assigns factor levels to the corresponding variables.
  21. Two files must be provided :
  22. One describing the formats to be used (permitting the re-use of a defined format), which must be formatted like so:
  23. value format_name
  24. value0_in_data_frame = 'Label for level 0'
  25. value1_in_data_frame = "Label for level 1"
  26. and so on.
  27. As shown, both single and double quotes are accepted.
  28. The value before the equal sign can be numeric (categorical coding) or text for recoding.
  29. The other file assigns defined formats to variables in the dataframe. It must be formatted like so:
  30. var1 var2 var3 varN format=format_name
  31. with one line for every assigned format.
  32. As always, be careful of the case sensitiveness.
  33. }
  34. \examples{
  35. \dontrun{df <- loadFormatsFromFile(df,"formats.txt","attribformats.txt")}
  36. }