openweather_set_key: Set the Open Weather Map key

Description Usage Arguments Details References See Also Examples

Description

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.

Usage

1

Arguments

key

A valid Open Weather Map API key as a string. Obtain one at the [API Keys](https://openweathermap.org/appid#get) page.

Details

'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.

References

See Open Weather Map APPID [API Keys](https://openweathermap.org/appid#get) to obtain an API key.

See Also

Note the Open Weather Map API documentation can be found here [API Docs](https://openweathermap.org/api).

Examples

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")

alexhallam/OpenWeatherPull documentation built on May 6, 2019, 7:02 p.m.