在r中的Likert图上显示百分比值

时间:2015-09-25 19:30:29

标签: r plot

我是一个喜欢的情节,我希望将情节的值叠加在图表上。我得到的代码如下。

 Strongly_Negative<-c(5.769230769,  11.42857143,    13.55932203,    02.272727273,   16.66666667,    14.84375,   1.492537313)
Negative<-c(32.69230769,  25.71428571,  15.25423729,    05.681818182,   20.83333333,    14.453125,  2.985074627)
Nuetral<-c(15.38461538,  14.28571429,   16.94915254,    09.090909091,   20.83333333,    13.671875,  17.91044776)
Positive<-c(26.92307692, 34.28571429, 35.59322034,  040.90909091,   33.33333333,    36.328125,  52.23880597)
Strongly_Positive<-c(19.23076923,  14.28571429, 18.6440678, 042.04545455,   8.333333333,    20.703125,  25.37313433)
my_df2<-data.frame(Strongly_Negative,Negative,Nuetral,Positive,Strongly_Positive) ##This is just dummy data to replicate the data you already have. You're probably going to want to open your own file in R if you want to do this multiple times!
my_df2

my_mat2<-as.matrix(my_df2)

as.likert(my_mat2)


likertplot(my_mat2, main='Responses',
           xlab="Percentage Responses",
           ylab="Site",
           levelsName=TRUE,
           plot.percents=TRUE)

例如,对于强烈同意的栏位于的站点1,将写入值19.2%。 非常感谢任何帮助。

0 个答案:

没有答案