I am new to R, and i am using the "likert" package to illustrate survey data. I have the following issue.
When i plot a likert-scale where all options are used, (the dataset contains observations for each of the 4 categories) i have no problem. But if no answers are present for one of the categories, i get the error:
item3 <- likert(comb2) Error in likert(comb2) : All items (columns) must have the same number of levels
I see the following option for the function 'likert': nlevels = length(levels(items[, 1]))) This might contain a solution, as the text says: "number of possible levels. Only necessary if there are missing levels."
However i dont know how to fill out the option.
My data looks like this:
str(comb2) 'data.frame': 1475 obs. of 2 variables:
$ Jeg er god til at bruge en computer (land) : Factor w/ 4 levels "a: Meget enig",..
$ Jeg er god til at bruge en computer (skole): Factor w/ 3 levels "a: Meget enig",..
The options are: "a: Meget enig" , "b: Lidt enig" , "c: Lidt uenig" , "d: Meget uenig" , Where one of the options are not present in one of the columns