感谢您的阅读。我发现我无法从现有数据中绘制线图,如下所示:
a=structure(list(ID = structure(1:3, .Names = c("V2", "V3", "V4"
), .Label = c(" day1", " day2", " day3"), class = "factor"),
Protein1 = structure(c(3L, 1L, 2L), .Names = c("V2",
"V3", "V4"), .Label = c("-0.651129553", "-1.613977035", "-1.915631511"
), class = "factor"), Protein2 = structure(c(3L,
1L, 2L), .Names = c("V2", "V3", "V4"), .Label = c("-1.438858662",
"-2.16361761", "-2.427593862"), class = "factor")), .Names = c("ID",
"Protein1", "Protein2"), row.names = c("V2",
"V3", "V4"), class = "data.frame")
我需要的是绘制如下图:
我尝试了以下代码,但结果不正确;
qplot(ID, Protein1, data=a, colour=ID, geom="line")
还:
a1<-melt(a, id.vars="ID")
ggplot(a1,aes(ID,value))+ geom_line()+geom_point()
非常感谢您的照顾。