[R] qplot

Vikas Rawal vikasrawal at gmail.com
Tue Feb 19 13:53:25 CET 2008


> Format your dataframe into a long format. Then use a grouping variable
> to distinguish both lines.
> 
> library(ggplot2)
> DF <- data.frame(X = rep(0:20, 2), Y = c(rnorm(21), runif(21)), Z =
> gl(2, 21))
> ggplot(data = DF, aes(x = X, y = Y, colour = Z)) + geom_line()

You can also use ggplot and then add layers for each geom_line that
you want to add.

Vikas

>



More information about the R-help mailing list