Create an Excel mapping file based on a labelled dataframe
Source:R/create-mapping.R
create_tabula.RdThis function first calls datadaptor::create_mapping_workbook().
Additionally to the sheets "Variables", "Label", "Verbatims" & "Free",
it will insert 2 more sheets "Macro" & "Questions".
The Excel workbook is then written to the file mapping_file.
Please refer to vignette("crosstabser") & vignette("questions-parameters")
for details how to use the mapping.
Examples
spss_file <- system.file(
"extdata",
"fruit_survey.sav",
package = "datadaptor"
)
df <- haven::read_sav(spss_file)
# The next command creates an empty mapping file `mapping.xlsx`:
if (FALSE) { # \dontrun{
create_tabula(df, "mapping.xlsx")
} # }