I have a data frame with 3 variables, which are all wind speeds. I want to check how well the hardware was calibrated by plotting all the variables against each other. Although there are three in this instance, it may be that there are up to 6.
This would result in 3 different graphs, where the x
and y
parameters keep changing. I'd really like to plot these using facets- or something with the same appearance.
Here is some sample data, in a data frame called wind
:
wind <- structure(list(speed_60e = c(3.029, 3.158, 2.881, 2.305, 2.45,
2.358, 2.325, 2.723, 2.567, 1.972, 2.044, 1.745, 2.1, 2.08, 1.914,
2.44, 2.356, 1.564, 1.942, 1.413, 1.756, 1.513, 1.263, 1.301,
1.403, 1.496, 1.828, 1.8, 1.841, 2.014), speed_60w = c(2.981,
3.089, 2.848, 2.265, 2.406, 2.304, 2.286, 2.686, 2.511, 1.946,
2.004, 1.724, 2.079, 2.058, 1.877, 2.434, 2.375, 1.562, 1.963,
1.436, 1.743, 1.541, 1.256, 1.312, 1.402, 1.522, 1.867, 1.837,
1.873, 2.055), speed_40 = c(2.726, 2.724, 2.429, 2.028, 1.799,
1.863, 1.987, 2.445, 2.282, 1.938, 1.721, 1.466, 1.841, 1.919,
1.63, 2.373, 2.22, 1.576, 1.693, 1.185, 1.274, 1.421, 1.071,
1.163, 1.166, 1.504, 1.77, 1.778, 1.632, 1.545)), .Names = c("speed_60e",
"speed_60w", "speed_40"), class = "data.frame", row.names = c("1",
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
"14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24",
"25", "26", "27", "28", "29", "30"))
R> head(wind)
speed_60e speed_60w speed_40
1 3.029 2.981 2.726
2 3.158 3.089 2.724
3 2.881 2.848 2.429
4 2.305 2.265 2.028
5 2.450 2.406 1.799
6 2.358 2.304 1.863
I wish to plot three square graphs. An individual one can be plotted by calling
ggplot() + geom_point(data=wind, aes(wind[,1],wind[,3]), alpha=I(1/30),
shape=I(20), size=I(1))
Any idea how I can do this?