dat.x <- data.frame(var1 = 1, var2 = 1.5, var3 = 3)
dat.y <- data.frame(var1 = 3, var2 = 1.5, var3 = 3)
plot(dat.x$var1, dat.y$var1, col = "red", xlim = c(0.6, 3.5), ylim = c(0, 4), xlab = "x", ylab = 'y')
points(dat.x$var2, dat.y$var2, col = "blue")
points(dat.x$var3, dat.y$var3, col = "green")
I have two data.frames, dat.x
and dat.y
, that contain the x and y coordinates of 3 observations. Is there a quick way to plot these points? Perhaps using melt
from the reshape2 package to organize the 2 data.frames into a single one?