Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/xpssAddValueLabels.R
R implementation of the SPSS ADD VALUE LABELS
function. xpssAddValueLabels
appends value labels for specific variables. Those values labels get stored in the attributes of the selected variable.
1 2 |
x |
a (non-empty) data.frame or input data of class |
variables |
atomic character or character vector with the name of the variables. |
values |
atomic numeric or numeric vector, respectively as an atomic character or character vector containing the value of the variable. |
labels |
atomic numeric or numeric vector, respectively as an atomic character or character vector containing the label of the variable. |
datevariables |
atomic date or date vector with the name of the date variables. |
datevalues |
atomic date or date vector containing the value of the date, the value has to be like the old date format. |
datelabels |
atomic numeric or numeric vector, respectively as an atomic character or character vector containing a variable label. |
The values labels are stored in the variable itself.
In contrast to xpssValueLabels
, xpssAddValueLabels
do not erase existing value labels.
If the value label for a specific variable already exists, this value label get overwritten.
If the value label for a specific variable does not exist, the value label get created without deleting the existing value label of that variable.
Supported attributes are:
value.labels
, defined.MIS
, MIS
, varname
, variable.label
An xpssFrame object with modified value labels.
Bastian Wiessner
read.spss
xpssValueLabels
xpssVariableLabels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data(fromXPSS)
fromXPSS <- xpssValueLabels(fromXPSS,
variables = "V1",
values = 1 ,
labels = "Label1")
fromXPSS <- xpssAddValueLabels(fromXPSS,
variables = "V1",
values = 2 ,
labels = "Label2")
fromXPSS <- xpssAddValueLabels(fromXPSS,
variables = "V1",
values = "B" ,
labels = "CharLabel")
attributes(fromXPSS$V1)$value.labels
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.