Plot Percents with Likert Package - Doesn`t work when grouping

后端 未结 4 1320
被撕碎了的回忆
被撕碎了的回忆 2021-01-18 23:29

I\'ve created some charts using the Likert package, however when I create plots by groups the plot.percents = TRUE won\'t give me the labels for each response category. The

4条回答
  •  春和景丽
    2021-01-19 00:02

    Even the example script that's included in the likert package documentation using the pisaitems data will not graph correctly the percent labels. It ends up looking like the image below when you run this code.

    require(likert)
    data(pisaitems)
    
    ##### Item 29: How often do you read these materials because you want to?
    title <- "How often do you read these materials because you want to?"
    items29 <- pisaitems[,substr(names(pisaitems), 1,5) == 'ST25Q']
    head(items29); ncol(items29)
    names(items29) = c("Magazines", "Comic books", "Fiction", "Non-fiction books", "Newspapers")
    
    l29g <- likert(items29, grouping=pisaitems$CNT)
    
    # Plots
    plot(l29g, plot.percents=TRUE, plot.percent.low=FALSE, 
         plot.percent.high=FALSE, plot.percent.neutral=FALSE) + 
         ggtitle(title)
    

提交回复
热议问题