DataScienceHobart / 2017-01-31-resbaztas-r

ResBaz Hobart R workshop
https://datasciencehobart.github.io/2017-01-31-resbaztas-r/
Other
0 stars 0 forks source link

AODN notes #4

Open mdsumner opened 7 years ago

mdsumner commented 7 years ago
mdsumner commented 7 years ago

I'm keen to help develop a set of R scripts to be available much like the Python ones are.

Here's a quick example, just for Argo. I've included boiler plate for using ggplot2 to plot the data, which is ideal for this kind of data set. Other data will need other read/visualize options, but I'm sure they are pretty straightforward. Keen to discuss what is of interest and how I can help guide different R options.

collection_url <- "http://geoserver-123.aodn.org.au/geoserver/ows?typeName=imos:argo_profile_data&SERVICE=WFS&outputFormat=csv&REQUEST=GetFeature&VERSION=1.0.0&CQL_FILTER=INTERSECTS(position%2CPOLYGON((142.822265625%20-43.814453125%2C142.822265625%20-42.759765625%2C150.380859375%20-42.759765625%2C150.380859375%20-43.814453125%2C142.822265625%20-43.814453125)))%20AND%20oxygen_sensor%20%3D%20true"

## # install.packages("readr")
library(readr)
d <- read_csv(collection_url)

## boilerplate code for plotting these data
## #install.packages("ggplot2")
#library(ggplot2)
#ggplot(d) + aes(longitude, latitude) + geom_point()
#ggplot(d) + aes(psal, temp, col = pres) + geom_point() + facet_wrap(~platform_number) + scale_y_log10()

Here's what the last plot line produces. Ggplot2 makes this kind of column choices, mapped to aesthetics and layout really straightforward.

image