I have done many graphs for likert scale questionaries using large datasets in its original form (microdata). But this time I’m working with a small dataframe which summarizes the results of processing a large dataset. The problem happens when working with summary dataframe and with uneven categories (Eg:4). The problem does not occur when working with microdata it just happens when working with summarized. Example (using pisaitems dataframe):
rm(list=ls())
data("pisaitems")
cana1 <- likert(pisaitems[2:4])
plot(cana1)
ST24Q01 <- prop.table(table(pisaitems$ST24Q01))*100
ST24Q02 <- prop.table(table(pisaitems$ST24Q02))*100
ST24Q03 <- prop.table(table(pisaitems$ST24Q03))*100
df2 <- as.data.frame(t(cbind(ST24Q01,ST24Q02,ST24Q03)))
df2 <- tibble::rownames_to_column(df2, "row_names")
colnames(df2)[1] <- c("Item")
cana2 <- likert(summary = df2)
plot(cana2)
I get de following message:
Error in data.frame(Item = results[, 1], low = low, neutral = neutral, :
object 'neutral' not found
As a clue, among many solutions that I've tried, I use the option "center", but it works just when using integer numbers and not when using "2.5" that will be the correct place to divide the 4 categories.
Could somebody help me to properly use likert R Package for summary dataframe intead of microdata with even number of categories?