I have issues trying to create a likert plot with two groups. I realized a survey in two communities. I now want to compare these two communities. So far, I have loaded a sheet with 3 columns. One column refers to the location (comm1, comm2), one includes the answers regarding econ_comm (1-6) and one includes the answers regarding future_persp (1-6). I created a likert-object and a first figure.
g_likert = likert(g[1:6])
plot(g_likert, ordered = FALSE, group.order = names(g[2:3]))
...and it worked. That's what I got so far. I now want to plot this according to each community, as in this example. I assume it's now important to create a both-object first: both<-g$Location
(worked)
Now I'm starting to get trouble. The following code shows me errors:
both_likert_2 = likert(both[, c(1:3), drop=FALSE], grouping = both$location)
plot(both_likert_2, include.histogram = TRUE)
The errors are:
- Error in [.data.frame`(g, 1:6) : undefined columns selected
- Error in [.default`(both, , c(1:3), drop = FALSE) : wrong number of dimensions
- Objekt 'both_likert_2' not found
I'm struggling for quite some time now and I would be very very grateful for some help. Best, Felix