knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
ambientweatheR
provides programmatic access to an Ambient Weather user's weather station data via REST API.
Ambient Weather API documentation available HERE.
Main functions:
list_user_devices
: Lists user's available devices and each device's most recent datafetch_device_data
: Fetches data from a device for a given date, or for the last 24 hoursdevtools::install_github("andrewflack/ambientweatheR")
library(ambientweatheR) library(tidyverse)
mac_address <- list_user_devices() %>% flatten() %>% pluck("macAddress")
df <- seq.Date(as.Date("2019-08-01"), as.Date("2019-08-04"), "day") %>% map(as.character) %>% map_df(~ fetch_device_data(mac_address, .x)$content)
load(system.file("extdata", "sysdata.rda", package = "ambientweatheR"))
df %>% select(date_time, tempf, feelsLike, dewPoint) %>% gather(key = "key", value = "value", -date_time) %>% ggplot(aes(x = date_time, y = value, colour = key)) + geom_point()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.