I have a dataset df:
library(gsheet)
df <- gsheet2tbl('docs.google.com/spreadsheets/d/1uSYy4gg4QTFoI81g1_WxI1YA0d6HfWIvv-RvlvMBLR8/edit?usp=sharing')
> head(df)
date elevation DO_mg_L
1 2016-06-07 10:00:00 268.8816 7.60
2 2016-06-07 10:00:00 272.1625 8.17
3 2016-06-07 10:00:00 275.3449 8.42
4 2016-06-07 10:00:00 265.3383 7.15
5 2016-06-07 10:00:00 262.2215 6.93
6 2016-06-07 10:00:00 258.9079 6.95
My question is similar to this and this.
The data contains a series of depth profiles conducted in a standing body of water. Thus the file contains a data, elevation, and a concentration. I would like to use this data to create an times series contour plot which shows time on y axis, elevation on the x axis, and a contour plot colored to represent oxygen concentration.
However, the data contains periods of missing data (which I'd like to leave blank), the elevations are not consistent, and the water level fluctuates. Thus I'm having trouble creating a matrix.
Ideally, my plot would look similar to something like this.
I have tried:
do.dep.tim <- with(df, interp(x = date, y = elevation, z = DO_mg_L))
filled.contour(x = df$x,
y = df$y,
z = df$z,
color.palette =
colorRampPalette(c("white", "blue")),
xlab = "Time",
ylab = "Elevation (Feet ASL)",
main = "Dissolved Oxygen",
key.title = title(main = "DO (mg L)", cex.main = 1))
I'd be thankful for help and advice.