Hello R and gglplot pros,
I am trying to create a graphics with R and ggplot2, which contains a dot plot, a box plot and a line plot. I attach an example, how the final result should look like:
I created a data frame (data) with data of four time points (in long format) and an additional ID variable:
ID time value
1 T1 11
1 T1 22
1 T2 11
2 T1 22
2 T2 22
2 T2 44
...
I am able to create both box and dot plots and differentiate the groups with the individual color. My ggplot2 script looks currently like that:
ggplot(data=data, aes(x=factor(time), y=value, fill=ID)) +
geom_boxplot(fill="white") +
geom_dotplot(binaxis="y", stackdir="center")
How can I connect the dots in T1 with the corresponding dots in T2, T3 T4?
Thanks in advance for any advise!
All the best, Chris


T1andT2are corresponding? - Stibu