How to deal with overlapping factor levels? (e.g. when producing tables and plots)

只愿长相守 提交于 2019-12-06 15:01:31

I think you have to duplicate those rows to represent each observation. and remove any with 0.

library(reshape2)
d2<-melt(data, id.var=c("ID","YEAR"))
d3<-d2[d2$value!=0,]
library(ggplot2)
qplot(d3$YEAR, d3$variable)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!