i have a data frame in R called df which is a subset of pisaitems data of likert package.
The problem i face is that when i plot the result of the likert function i want to wrap the text of the categories that start with “Strongly” and the agree or disagree to appear below the word Strongly.How can i do that in this likert package setting using ggplot2 ?
<code>dput(df)
structure(list(ST24Q01 = structure(c(2L, 2L, 4L, 2L, 1L, 2L,
2L, 2L, 2L, 4L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L,
4L, 2L, 2L, 2L, 1L, 2L, 1L, 4L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L,
2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q02 = structure(c(4L,
1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 2L,
4L, 4L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L,
4L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q03 = structure(c(4L, 1L, 1L, 2L, 1L,
1L, 2L, 1L, 2L, 1L, 4L, 2L, 1L, 2L, 4L, 2L, 4L, 2L, 2L, 2L, 2L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q04 = structure(c(1L,
4L, 2L, 1L, 2L, 2L, 4L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 2L, 1L,
2L, 1L, 1L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q05 = structure(c(4L, 1L, 1L, 2L, 1L,
1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 4L, 4L, 2L, 2L,
1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q06 = structure(c(1L,
2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 1L, 2L, 1L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q07 = structure(c(2L, 1L, 1L, 2L, 2L,
1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L,
4L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 4L, 4L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q08 = structure(c(2L,
2L, 2L, 1L, 2L, 2L, 4L, 2L, 2L, 4L, 2L, 2L, 2L, 2L, 1L, 1L, 2L,
2L, 2L, 1L, 1L, 4L, 4L, 2L, 4L, 1L, 2L, 1L, 2L, 4L, 2L, 2L, 2L,
1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q09 = structure(c(1L, 4L, 2L, 1L, 2L,
4L, 2L, 1L, 2L, 4L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, 1L,
2L, 2L, 2L, 4L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L,
2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q10 = structure(c(2L,
1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 2L, 4L, 2L, 4L,
4L, 4L, 4L, 4L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L,
4L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 4L, 2L,
4L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q11 = structure(c(2L, 1L, 1L, 2L, 1L,
1L, 2L, 2L, 2L, 1L, 4L, 1L, 1L, 4L, 2L, 2L, 4L, 4L, 4L, 2L, 2L,
2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 2L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor")), row.names = 68038:68087, class = "data.frame")
</code>
<code>dput(df)
structure(list(ST24Q01 = structure(c(2L, 2L, 4L, 2L, 1L, 2L,
2L, 2L, 2L, 4L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L,
4L, 2L, 2L, 2L, 1L, 2L, 1L, 4L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L,
2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q02 = structure(c(4L,
1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 2L,
4L, 4L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L,
4L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q03 = structure(c(4L, 1L, 1L, 2L, 1L,
1L, 2L, 1L, 2L, 1L, 4L, 2L, 1L, 2L, 4L, 2L, 4L, 2L, 2L, 2L, 2L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q04 = structure(c(1L,
4L, 2L, 1L, 2L, 2L, 4L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 2L, 1L,
2L, 1L, 1L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q05 = structure(c(4L, 1L, 1L, 2L, 1L,
1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 4L, 4L, 2L, 2L,
1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q06 = structure(c(1L,
2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 1L, 2L, 1L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q07 = structure(c(2L, 1L, 1L, 2L, 2L,
1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L,
4L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 4L, 4L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q08 = structure(c(2L,
2L, 2L, 1L, 2L, 2L, 4L, 2L, 2L, 4L, 2L, 2L, 2L, 2L, 1L, 1L, 2L,
2L, 2L, 1L, 1L, 4L, 4L, 2L, 4L, 1L, 2L, 1L, 2L, 4L, 2L, 2L, 2L,
1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q09 = structure(c(1L, 4L, 2L, 1L, 2L,
4L, 2L, 1L, 2L, 4L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, 1L,
2L, 2L, 2L, 4L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L,
2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q10 = structure(c(2L,
1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 2L, 4L, 2L, 4L,
4L, 4L, 4L, 4L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L,
4L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 4L, 2L,
4L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q11 = structure(c(2L, 1L, 1L, 2L, 1L,
1L, 2L, 2L, 2L, 1L, 4L, 1L, 1L, 4L, 2L, 2L, 4L, 4L, 4L, 2L, 2L,
2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 2L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor")), row.names = 68038:68087, class = "data.frame")
</code>
dput(df)
structure(list(ST24Q01 = structure(c(2L, 2L, 4L, 2L, 1L, 2L,
2L, 2L, 2L, 4L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L,
4L, 2L, 2L, 2L, 1L, 2L, 1L, 4L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L,
2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q02 = structure(c(4L,
1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 2L,
4L, 4L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L,
4L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q03 = structure(c(4L, 1L, 1L, 2L, 1L,
1L, 2L, 1L, 2L, 1L, 4L, 2L, 1L, 2L, 4L, 2L, 4L, 2L, 2L, 2L, 2L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q04 = structure(c(1L,
4L, 2L, 1L, 2L, 2L, 4L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 2L, 1L,
2L, 1L, 1L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q05 = structure(c(4L, 1L, 1L, 2L, 1L,
1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 4L, 4L, 2L, 2L,
1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q06 = structure(c(1L,
2L, 4L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 1L, 2L, 1L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q07 = structure(c(2L, 1L, 1L, 2L, 2L,
1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L,
4L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 4L, 4L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q08 = structure(c(2L,
2L, 2L, 1L, 2L, 2L, 4L, 2L, 2L, 4L, 2L, 2L, 2L, 2L, 1L, 1L, 2L,
2L, 2L, 1L, 1L, 4L, 4L, 2L, 4L, 1L, 2L, 1L, 2L, 4L, 2L, 2L, 2L,
1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L,
1L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q09 = structure(c(1L, 4L, 2L, 1L, 2L,
4L, 2L, 1L, 2L, 4L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, 1L,
2L, 2L, 2L, 4L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L,
2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor"), ST24Q10 = structure(c(2L,
1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 4L, 2L, 1L, 2L, 4L, 2L, 4L,
4L, 4L, 4L, 4L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L,
4L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 4L, 2L,
4L), levels = c("Strongly disagree", "Disagree", "Agree", "Strongly agree"
), class = "factor"), ST24Q11 = structure(c(2L, 1L, 1L, 2L, 1L,
1L, 2L, 2L, 2L, 1L, 4L, 1L, 1L, 4L, 2L, 2L, 4L, 4L, 4L, 2L, 2L,
2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 1L, 2L, 1L, 4L), levels = c("Strongly disagree",
"Disagree", "Agree", "Strongly agree"), class = "factor")), row.names = 68038:68087, class = "data.frame")
<code>df
library(tidyverse)
library(likert)
likert1<-likert::likert(df)
plot(likert1 ,
centered = TRUE, center = 3 ,
ordered = FALSE ,
include.center=TRUE ,
low.color = 'red',
neutral.color = 'lightblue' ,
high.color='green' ,facet=TRUE ,
legend.position = "bottom" ,
pch = 0.7 ,
lcolor = "Black", wrap = 70) +
theme(axis.text.y = element_text(colour="black", size="11", hjust =0)) +
theme(legend.title=element_blank())
</code>
<code>df
library(tidyverse)
library(likert)
likert1<-likert::likert(df)
plot(likert1 ,
centered = TRUE, center = 3 ,
ordered = FALSE ,
include.center=TRUE ,
low.color = 'red',
neutral.color = 'lightblue' ,
high.color='green' ,facet=TRUE ,
legend.position = "bottom" ,
pch = 0.7 ,
lcolor = "Black", wrap = 70) +
theme(axis.text.y = element_text(colour="black", size="11", hjust =0)) +
theme(legend.title=element_blank())
</code>
df
library(tidyverse)
library(likert)
likert1<-likert::likert(df)
plot(likert1 ,
centered = TRUE, center = 3 ,
ordered = FALSE ,
include.center=TRUE ,
low.color = 'red',
neutral.color = 'lightblue' ,
high.color='green' ,facet=TRUE ,
legend.position = "bottom" ,
pch = 0.7 ,
lcolor = "Black", wrap = 70) +
theme(axis.text.y = element_text(colour="black", size="11", hjust =0)) +
theme(legend.title=element_blank())
i receive :