Hi list,
I would like to use ggplot2 in creating a line plot with 4 lines (groups), 2
of which I want in colour and the remaining two as dotted lines.

### R code ###
library(ggplot2)

### create data ####
vals <- rnorm(400)
div<- c(rep("A",100),rep("B",100),rep("C",100),rep("D",100))
n<- rep(1:100,4)
df<- data.frame(div= as.factor(div),vals=vals,n=n)

### ggplot function ####
qplot(x=n,y=vals, colour = div ,geom = "line",data=df)

What I would like to see is a line plot where I can have lines for groups A,
and B in colour and lines for C and D in dotted and dashed respectively.

Also, I would like to know how I can draw two lines (groups C and D) which
are both dotted.


Thanks
Regards
Harsh Singhal

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to