I have a data (R dataframe) like this:
Treatment Diameter(inches).Sep Diameter(inches).Dec
Aux_Drop NA NA
Aux_Spray 3.7 2
DMSO NA NA
Water 4.2 2
Aux_Drop 2.6 3
Aux_Spray 3.7 3
DMSO 4 2
Water 5.2 1
Aux_Drop 5.4 2
Aux_Spray 3.4 2
DMSO 4.8 2
Water 4.2 2
Aux_Drop 4.7 2
Aux_Spray 2.7 2
DMSO 3.4 2
Water 4.9 2
.......
.......
I want to make a scatter (or x, y) plot of diameter
for each treatment
group. I have found lattice
library plot more helpful as of now and I have used:
require(lattice)
xyplot(`Diameter(inches).Sep` ~ Treatment , merged.Sep.Dec.Mar, pch= 20)
to generate the plot:
However, I want to add the scatter plot for "Diameter from Dec" next to the "Diameter of Sep" for each treatments with different color. I am not able to find a workable example that I can use for my purpose so far.
Method with lattice
, ggplot2
or base plot
or any other would be really helpful.
Thanks,