Plotting multiple lines from a data frame in R

前端 未结 3 668
孤街浪徒
孤街浪徒 2020-12-18 04:23

I am building an R function to plot a few lines from a data table, I don\'t understand why this is not working?

data = read.table(path, header=TRUE);
plot(da         


        
3条回答
  •  北海茫月
    2020-12-18 04:37

    Have a look at the ggplot2 package

    library(ggplot2)
    library(reshape)
    data <- data.frame(time = seq(0, 23), noob = rnorm(24), plus = runif(24), extra = rpois(24, lambda = 1))
    Molten <- melt(data, id.vars = "time")
    ggplot(Molten, aes(x = time, y = value, colour = variable)) + geom_line()
    

    enter image description here

提交回复
热议问题