I have survey data that I am trying to plot in R but the issue is that the responses appear in alphabetical order as seen in the graph below:
I would like the responses to be in the order “Strongly Disagree”, “Disagree”, “Neither Disagree nor Agree”, “Agree”, “Strongly Agree”.
I tried re-ordering the factors for each column of the dataframe using
levels = c("Strongly Disagree", "Disagree", "Neither Disagree nor Agree", "Agree", "Strongly Agree")
but this collapsed the dataframe into a single column with no data.
Here is the code I used that returns the plot with the responses in alphabetical order:
attitudes <- sub_survey %>%
select(i_sub_no_perm_job,
i_sub_flexibility,
i_sub_help_local_school,
amnt_sub_wrk_incrsing,
i_wrk_max_avlbl_hrs,
sub_wrk_not_attractive_low_pay) %>%
rename("I provide substitution work because I can't find a permanent job" = i_sub_no_perm_job,
"I provide substitution work because I enjoy the flexibility" = i_sub_flexibility,
"I provide substitution work because I want to help out my local school" = i_sub_help_local_school,
"I believe the amount of substitution work available is increasing in my area" = amnt_sub_wrk_incrsing,
"I work the maximum number of substitution hours I am available for" = i_wrk_max_avlbl_hrs,
"Substitution work is not an attractive option for me as the pay/conditions are poor" = sub_wrk_not_attractive_low_pay) %>%
na.omit()
attitudes[] <- lapply(attitudes, factor)
plot(likert(attitudes),legend.position = "right")