Skip to content
Prev 378559 / 398502 Next

Using ggplot2 geom_path() in a grouped variable

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)))
+ geom_point()

I believe that the time you are declaring the control group (inside
the ggplot() function instead the geom_point()) makes your code do the
right way and that my code links the last observation of group zero
with the first observation of group one.

Thank you Rui, and thanks all of you guys for take the time to read
and answer my post.

Regards
Norberto

El mar., 12 feb. 2019 a las 16:22, Rui Barradas
(<ruipbarradas at sapo.pt>) escribi?: