- Run the tests from documentation
library(darksky)
library(testthat)
date()
test_dir("tests/")
- Confirm your API key and check its required location
The API wrapper functions in this package all rely on a Dark Sky API key residing in the environment variable \code{DARKSKY_API_KEY}. The easiest way to accomplish this is to set it in the \code{.Renviron} file in your home directory.
- Check to see if you are within any limit on API calls
print(sprintf("You have used %s API calls.", then$`x-forecast-api-calls`))
- Run the example
seq(Sys.Date()-10, Sys.Date(), "1 day") %>%
map(~get_forecast_for(43.2672, -70.8617, .x)) %>%
map_df("hourly") %>%
ggplot(aes(x=time, y=temperature)) +
geom_line()