In order to access the API, you need to sign up for an API key
at https://openweathermap.org/.
For optional parameters (...
) in functions see
https://openweathermap.org/api/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
# first of all you have to set up your api key
owmr_settings("your_api_key")
# or store it in an environment variable called OWM_API_KEY (recommended)
Sys.setenv(OWM_API_KEY = "your_api_key") # if not set globally
# get current weather data for "Kassel" with temperatures in <c2><b0>C
get_current("Kassel", units = "metric")
# get 3h forcast data (7 rows)
get_forecast("London", cnt = 7)
# ...
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.