inst/examples/example-varlabels.R

# Extract the variable labels from membersurvey

ms <- membersurvey[, c("id", "Q1", "Q2")]

str(ms)
varlabels(ms)
varlabels(ms)["Q2"]

# Assign a new value to the text of question 2

varlabels(ms)["Q2"] <- "When did you join?"
varlabels(ms)
str(ms["Q2"])

Try the surveydata package in your browser

Any scripts or data that you put into this service are public.

surveydata documentation built on July 20, 2017, 1:04 a.m.