Description Usage Arguments Details References See Also Examples
Users of the 'openweather' package must authenticate with the API by use of an API key. The function 'openweather_set_key()' sets the Open Weather Map API key as an environment variable for use with the service. For persistence across sessions, see the Details section.
1 | openweather_set_key(key)
|
key |
A valid Open Weather Map API key as a string. Obtain one at the [API Keys](https://openweathermap.org/appid#get) page. |
'openweather_set_key()' sets a key as an environment variable for use with the 'openweather' package in the current session. The key can also be set in the '.Renviron' file at the user or project level scope.
See Open Weather Map APPID [API Keys](https://openweathermap.org/appid#get) to obtain an API key.
Note the Open Weather Map API documentation can be found here [API Docs](https://openweathermap.org/api).
1 2 3 4 5 | current_key <- Sys.getenv("OPENWEATHER_API_KEY")
openweather_set_key("abcdefghijklmnopqrstuvwxyz123456")
Sys.getenv("OPENWEATHER_API_KEY")
openweather_set_key(current_key)
Sys.getenv("OPENWEATHER_API_KEY")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.