How to create a faceted line-graph using ggplot?

后端 未结 2 571
暖寄归人
暖寄归人 2021-02-18 13:37

I have a data frame created with this code:

require(reshape2)
foo <- data.frame( abs( cbind(rnorm(3),rnorm(3, mean=.8),rnorm(3, mean=.9),rnorm(3, mean=1))))
q         


        
2条回答
  •  孤街浪徒
    2021-02-18 14:24

    Try this:

    ggplot(data=alldf.m, aes(x=variable, y = value, colour = ID, group = ID)) + 
      geom_line() + facet_wrap(~fn)
    

    enter image description here

提交回复
热议问题