Vielen Dank für deine schnelle Rückmeldung. Ich bin mal ein paar Schritte zurückgegangen und habe nun einen einfachen Likert-Plot ohne Gruppen erstellen können. Auch habe ich versucht ein Both-Object zu erstellen.
Code: Alles auswählen
g<-read.csv2("C:/Users/felix/OneDrive/Documents/R/SurveyData.csv", sep=";", dec=",", header=TRUE)
str(g)
by(g, g$Location, FUN=summary)
xtabs(~ Location + econ_comm, data=g)
tapply(g$future_persp, g$Location, FUN=table)
#Both-Object erstellen
both<-g$Location
#Convert values to factors - Nicht nötig!?
g[1:6] = lapply(g, factor, levels = 1:6)
#Create a likert object
g_likert = likert(g[1:6])
#Figure 2
plot(g_likert, ordered = FALSE, group.order = names(g[2:3]))
both_likert_2 = likert(both[, c(1:3), drop=FALSE], grouping = both$location)
plot(both_likert_2, include.histogram = TRUE)
Code: Alles auswählen
> g_likert = likert(g[1:6])
Fehler in `[.data.frame`(g, 1:6) : undefined columns selected
> #Figure 2
> plot(g_likert, ordered = FALSE, group.order = names(g[2:3]))
> both_likert_2 = likert(both[, c(1:3), drop=FALSE], grouping = both$location)
Fehler in `[.default`(both, , c(1:3), drop = FALSE) :
falsche Anzahl von Dimensionen
> plot(both_likert_2, include.histogram = TRUE)
Fehler in plot(both_likert_2, include.histogram = TRUE) :
Objekt 'both_likert_2' nicht gefunden