Re: [R] Using ggplot2 geom_path() in a grouped variable

2019-02-12 Thread Norberto Hernandez
Rui: Thank you very much for your help! It works the way you do. My problem was with the time I declare the control group: My code: p <- ggplot(data, aes(Pretrend, Outcome)) + geom_point(aes(colour=factor(Control)) Your solution: p <- ggplot(data, aes(Pretrend, Outcome, colour = factor(Control))

Re: [R] Using ggplot2 geom_path() in a grouped variable

2019-02-12 Thread David Winsemius
To Norberto; Your code _probably_ would have succeeded if you had used color as a grouping argument, or you could have used group or linetype or probably others, but I find locating the listing of ggplot2 "behavioral" parameters rather frustrating. These details are not to be found in any of ?a

Re: [R] Using ggplot2 geom_path() in a grouped variable

2019-02-12 Thread Rui Barradas
Hello, I am not understanding the problem. With a made up dataset everything seems right. set.seed(1234)# make the results reproducible n <- 10 data <- data.frame(Pretrend = rep(1:10, 2), Outcome = 1:10 + rnorm(2*n), Control = rep(1:2, each = n)) libra

Re: [R] Using ggplot2 geom_path() in a grouped variable

2019-02-12 Thread David Winsemius
> On Feb 12, 2019, at 2:09 PM, Norberto Hernandez > wrote: > > Hi! I am trying to make a scatter/path graph in one variable that is > divided in two groups (variable Control), but when I use the > geom_path() option, the line continues from the group one to the group > two, and I wasn't able

[R] Using ggplot2 geom_path() in a grouped variable

2019-02-12 Thread Norberto Hernandez
Hi! I am trying to make a scatter/path graph in one variable that is divided in two groups (variable Control), but when I use the geom_path() option, the line continues from the group one to the group two, and I wasn't able to avoid it.I need the path draws over the group one and then draws over th

[R] using ggplot2 geom_path() in a grouped variable

2019-02-07 Thread Norberto Hernandez
Hi! I am trying to make a scatter/path graph in one variable that is divided in two groups (variable Control), but when I use the geom_path() option, the line continues from the group one to the group two, and I wasn't able to avoid it.I need the path draws over the group one and then draws over th