Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

add.value.labels

Add value labels


Description

Adds value labels to a variable.

Usage

add.value.labels(x,value.labels)

Arguments

x

The variable to add the labels.

value.labels

The labels.

Details

add.value.labels adds value labels like those from an SPSS .sav file. It makes it a bit easier to stick on value labels that have been lost or were not there in the first place.

Value

The variable with the labels added.

Author(s)

Jim Lemon

Examples

fgh<-data.frame(sex=sample(1:2,20,TRUE),viviality=sample(1:3,20,TRUE))
 fgh$sex<-add.value.labels(fgh$sex,c("Female","Male"))
 fgh$viviality<-add.value.labels(fgh$viviality,c("Alive","Dead","Zombie"))

prettyR

Pretty Descriptive Stats

v2.2-3
GPL (>= 2)
Authors
Jim Lemon <drjimlemon@gmail.com>, Philippe Grosjean <phgrosjean@sciviews.org>
Initial release
2019-04-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.