I have this dataset: https://dl.dropboxusercontent.com/u/73950/data.csv The dataset contains 3 variables.
Here's how I visualize the data right now:
library(ggplot2)
library(reshape2)
library(RColorBrewer)
dat = read.csv("data.csv", header = FALSE)
myPalette <- colorRampPalette(rev(brewer.pal(11, "Spectral")))
sc <- scale_colour_gradientn(colours = myPalette(100))
ggplot(dat, aes(x=V1, y=V3, colour = V2))+ geom_point(alpha = .2,size = 3) + sc
Instead of just one figure, I'd like to facet the figure to display 3 different ways to attribute variables to each axis and color. As such:
- x = V1, y = V2, color = V3
- x = V1, y = V3, color = V2
- x = V2, y = V3, color = V1
How to do this kind of things with ggplot2's faceting?