如何在需要连续样品线的地方绘制这种数据?样品A,B和C需要三条线;值在Y轴上,rec在X轴上。
mydata<- structure(list(samples = structure(c(1L, 2L, 3L, 1L, 2L, 3L), .Label = c("A",
"B", "c"), class = "factor"), value = c(1, 8, 7, 2, 5, 9), rec = c(7158,
6975, 6573, 1122, 2235, 229)), .Names = c("samples", "value",
"rec"), class = "data.frame", row.names = c(NA, -6L))
答案 0 :(得分:3)
您可以使用ggplot2
来实现library(ggplot2)
ggplot(mydata, aes(x = rec, y = value)) + geom_line(aes(group = samples))