x <- as.item(sample(1:3,10,replace=TRUE),
labels=c("1. One"=1,
"2. Two"=2,
"2. Three"=3))
y <- as.item(sample(1:2,10,replace=TRUE),
labels=c("1. First category"=1,
"2. Second category"=2))
ds <- data.set(x,y)
x <- trim_labels(x)
codebook(x)
ds <- trim_labels(ds)
codebook(ds)
Run the code above in your browser using DataLab