我有一份数据,看起来像这样this。
我希望创建多个密度曲线到一个图中,其中每条曲线对应唯一的ID。
我尝试使用"sm"包和这段代码,但没有成功。
library(sm)
dat <- read.table("mydat.txt");
plotfn <- ("~/Desktop/flowgram_superimposed.pdf");
pdf(plotfn);
sm.density.compare(dat$V1,dat$V2, xlab = "Flow Signal")
colfill <- c(2:10);
legend(locator(1), levels(dat$V2), fill=colfill)
dev.off();
请指导正确的方法,或者是否有其他方法可以实现?
我试图在最后得到这种类型的图表。 figure http://img524.imageshack.us/img524/2736/testl.png