I am using a dataset that has likert scale responses. I am attaching sample observations from the dataset below.
I am always get an error, can someone help me with this?
Thanks
att<-structure(list(att1_goodofall = c(3L, 3L, 1L, 3L, 3L, 3L, 3L,
2L, 3L, 3L), att2_pvtdisease = c(3L, 3L, 2L, 2L, 3L, 3L, 3L,
3L, 3L, 3L), att3_curedisease = c(3L, 1L, 3L, 2L, 2L, 1L, 2L,
3L, 3L, 3L), att4_timewaste = c(4L, 4L, 2L, 3L, 4L, 4L, 4L, 4L,
4L, 4L), att5_helpgenerations = c(3L, 3L, 3L, 3L, 2L, 3L, 3L,
2L, 3L, 3L)), row.names = c(NA, 10L), class = "data.frame")
#labelling the values
for(i in att) {
val_lab(att)<-make_labels("0 Strongly disagree
1 Disagree
2 Neither agree or disagree
3 Agree
4 Strongly agree")
}
#plot_likert function
plot_likert(at)
Error in freq[valid] <- counts :
NAs are not allowed in subscripted assignments