This library serves as the official R client to the Array of Things API.
This isn't listed with CRAN yet (because it's awful -- I'm not an R developer). You can install it from GitHub though:
devtools::install_github("UbranCCD-UChicago/aot-client-r")
There are two general types of functions presented: ls and stat. You should use the ls functions to work with the list endpoints, and stat is for details:
ls.projects
to get a list of projectsls.nodes
to get a list of nodesls.sensors
to get a list of sensorsls.observations
to get the observation datals.raw_observations
to get the raw observation datastat.project
to get details for a single projectstat.node
to get details for a single nodestat.sensor
to get details for a single sensor
The stat functions require a unique id for the type of metadata you're looking for -- slug
for
projects, vsn
for nodes, and path
for sensors.
All of the functions allow you to add arbitrary filters/parameters as well:
# sensors onboard node 004
df <- ls.sensors(filters=list(onboard_node="004"))
# note: this doesn't work quite right but it will soon
# average temperature observations made in august per node
df <- ls.observations(filters=list(
by_sensor="metsense.bmp180.temperature",
timestamp="ge:2018-08-01T00:00:00",
timestamp="lt:2018-09-01T00:00:00",
value="avg:node_vsn"
))