Reformat a combined translation table into a standard one
Source:R/parse_combined_translation_table.R
parse_combined_translation_table.RdPart of the import sequence for a combined translation table,
which can be produced by create_blank_translation_table and
edited externally (for example, as a CSV file). This function
takes a single data frame and splits it into as many smaller
translation tables as are indicated by the number. of headers.
Value
A translation table list, translation_list,
each member of which is a translation table for a
given categorical variable.
Details
It returns the translation table list used as the main
translation table format by transcats.
Examples
gss_translation_combined <- readr::read_csv(
fs::path_package("extdata", "gss_cat_transtable_complete.csv",
package = "transcats"))
#> Rows: 86 Columns: 3
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (3): en, es, fr
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
gss_translation <- parse_combined_translation_table(gss_translation_combined)