Learn R Programming

projoint (version 1.0.6)

save_labels: Save attribute and level labels to a CSV file

Description

Saves the attributes and levels (and their order) from a projoint_data object, as generated by reshape_projoint, to a CSV file. This enables manual reordering and later re-import via read_labels.

Usage

save_labels(.data, .filename)

Value

No return value, called for side effects (writes a CSV file).

Arguments

.data

A projoint_data object.

.filename

A character string giving the name of a CSV file to be written.

See Also

read_labels, reshape_projoint

Examples

Run this code
# \donttest{
library(projoint)
data(exampleData1)
reshaped <- reshape_projoint(
  exampleData1,
  .outcomes = c(paste0("choice", 1:8), "choice1_repeated_flipped")
)
tmpfile <- tempfile(fileext = ".csv")
save_labels(reshaped, tmpfile)
readLines(tmpfile, n = 5)  # show first few lines
# }

Run the code above in your browser using DataLab