Data :
Cat <- c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4)
variable <- c("IL_1_Flag_p", "IL_1_Flag_p", "IL_1_Flag_p", "IL_1_Flag_p", "IL_2_Flag_p", "IL_2_Flag_p", "IL_2_Flag_p","IL_2_Flag_p", "IL_3_Flag_p", "IL_3_Flag_p", "IL_3_Flag_p", "IL_3_Flag_p", "IL_4_Flag_p", "IL_4_Flag_p", "IL_4_Flag_p", "IL_4_Flag_p", "IL_5_Flag_p", "IL_5_Flag_p", "IL_5_Flag_p", "IL_5_Flag_p")
value <- c(21,17,16,210,20,17,15,189,20,17,15,188,19,17,15,188,20,17,15,194)
agg_melt_p <- data.frame(cat, variable, value)
我只想为变量列中的“IL5\u Flag\u p”绘制折线图。已尝试使用
subset
从…起
plyr
包,但它不工作并显示错误。我正在组合两个图(条形图和折线图)。原始数据使用来自
melt
在里面
reshape2
对于ggplot,我使用的是这篇文章:
ggplot() + geom_line(data = agg_melt_p, aes(x=Category , y=value , colour=variable))
请帮忙