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)
我想仅为&#34; IL5_Flag_p&#34;绘制折线图。它位于变量列中。使用来自subset
包的plyr
但是它无效并显示错误。我正在组合2个图表(条形图和此折线图)。原始数据使用melt
中reshape2
的融合数据框
对于ggplot我正在使用这篇文章:
ggplot() + geom_line(data = agg_melt_p, aes(x=Category , y=value , colour=variable))
请帮忙