Title: | R Wrapper for the 'Climacell' API |
---|---|
Description: | 'Climacell' is a weather platform that provides hyper-local forecasts and weather data. This package enables the user to query the core layers of the time line interface of the 'Climacell' v4 API <https://www.climacell.co/weather-api/>. This package requires a valid API key. See vignettes for instructions on use. |
Authors: | Nikhil Agarwal [aut, cre] |
Maintainer: | Nikhil Agarwal <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.4 |
Built: | 2024-11-08 02:56:29 UTC |
Source: | https://github.com/nikdata/rclimacell |
This function will make a call to the Climacell API and retrieve sunrise, sunset times and moon phase variables.
climacell_celestial( api_key, lat, long, timestep = "1d", start_time = NULL, end_time = NULL )
climacell_celestial( api_key, lat, long, timestep = "1d", start_time = NULL, end_time = NULL )
api_key |
character string representing the private API key. Provided by user or loaded automatically from environment variable (environment variable must be called "CLIMACELL_API"). |
lat |
a numeric value (or a string that can be coerced to numeric) representing the latitude of the location. |
long |
a numeric value (or a string that can be coerced to numeric) representing the longitude of the location. |
timestep |
a 'step' value for the time. For the |
start_time |
the start time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. It is recommended that the |
end_time |
the end time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. For this function, the end_time cannot be greater than 15 days from the current date/time. |
climacell_celestial
returns a tibble that consists of sunrise/sunset times along with the moon phase (code & description).
a tibble
## Not run: climacell_celestial( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = '1d', start_time = lubridate::now(), end_time = lubridate::now() + lubridate::days(5)) ## End(Not run)
## Not run: climacell_celestial( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = '1d', start_time = lubridate::now(), end_time = lubridate::now() + lubridate::days(5)) ## End(Not run)
climacell_core
returns a tibble that contains all of the Core Layer data from the Climacell version 4 API using the Timelines interface. The intent of this function is to retrieve all of the Core Layer data in a single API call. This is especially handy when using the free API as it limits the usage of the API based on hourly rate and daily usage.
climacell_core( api_key, lat, long, timestep, start_time = NULL, end_time = NULL )
climacell_core( api_key, lat, long, timestep, start_time = NULL, end_time = NULL )
api_key |
character string representing the private API key. Provided by user or loaded automatically from environment variable (environment variable must be called "CLIMACELL_API"). |
lat |
a numeric value (or a string that can be coerced to numeric) representing the latitude of the location. |
long |
a numeric value (or a string that can be coerced to numeric) representing the longitude of the location. |
timestep |
a 'step' value for the time. Choose one of the following valid values: c('1d', '1h', '30m','15m','5m','1m','current'). |
start_time |
the start time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. It is recommended that the |
end_time |
the end time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. OPTIONAL if timestep is 'current' or if the user desires to get the maximum results possible (depends on the timestep chosen). |
a tibble
## Not run: climacell_core( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = '1d', start_time = lubridate::now(), end_time = lubridate::now + lubridate::days(5)) ## End(Not run)
## Not run: climacell_core( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = '1d', start_time = lubridate::now(), end_time = lubridate::now + lubridate::days(5)) ## End(Not run)
This function will make a call to the Climacell API and retrieve precipitation related (including cloud cover & pressure) values.
climacell_precip( api_key, lat, long, timestep, start_time = NULL, end_time = NULL )
climacell_precip( api_key, lat, long, timestep, start_time = NULL, end_time = NULL )
api_key |
character string representing the private API key. Provided by user or loaded automatically from environment variable (environment variable must be called "CLIMACELL_API"). |
lat |
a numeric value (or a string that can be coerced to numeric) representing the latitude of the location. |
long |
a numeric value (or a string that can be coerced to numeric) representing the longitude of the location. |
timestep |
a 'step' value for the time. Choose one of the following valid values: c('1d', '1h', '30m','15m','5m','1m','current'). |
start_time |
the start time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. It is recommended that the |
end_time |
the end time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. OPTIONAL if timestep is 'current' or if the user desires to get the maximum results possible (depends on the timestep chosen). |
climacell_precip
returns a tibble that consists of precipitation related variables (returned values are in metric units) using the Climacell API. These variables consist of precipitation intensity, precipitation probability, precipitation description, visibility, surface & sea level pressure, cloud cover & ceiling, and a weather description.
a tibble
## Not run: climacell_precip( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = 'current') ## End(Not run)
## Not run: climacell_precip( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = 'current') ## End(Not run)
This function will make a call to the Climacell API and retrieve temperature related variables.
climacell_temperature( api_key, lat, long, timestep, start_time = NULL, end_time = NULL )
climacell_temperature( api_key, lat, long, timestep, start_time = NULL, end_time = NULL )
api_key |
character string representing the private API key. Provided by user or loaded automatically from environment variable (environment variable must be called "CLIMACELL_API"). |
lat |
a numeric value (or a string that can be coerced to numeric) representing the latitude of the location. |
long |
a numeric value (or a string that can be coerced to numeric) representing the longitude of the location. |
timestep |
a 'step' value for the time. Choose one of the following valid values: c('1d', '1h', '30m','15m','5m','1m','current'). |
start_time |
the start time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. It is recommended that the |
end_time |
the end time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. OPTIONAL if timestep is 'current' or if the user desires to get the maximum results possible (depends on the timestep chosen). |
climacell_temperature
returns a tibble that consists of temperature related variables (returned values are in metric units) using the Climacell API. These variables consist of temperature, a "feels like" temperature, dewpoint, and humidity.
a tibble
## Not run: climacell_temperature( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = 'current') ## End(Not run)
## Not run: climacell_temperature( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = 'current') ## End(Not run)
This function will make a call to the Climacell API and retrieve wind related variables.
climacell_wind( api_key, lat, long, timestep, start_time = NULL, end_time = NULL )
climacell_wind( api_key, lat, long, timestep, start_time = NULL, end_time = NULL )
api_key |
character string representing the private API key. Provided by user or loaded automatically from environment variable (environment variable must be called "CLIMACELL_API"). |
lat |
a numeric value (or a string that can be coerced to numeric) representing the latitude of the location. |
long |
a numeric value (or a string that can be coerced to numeric) representing the longitude of the location. |
timestep |
a 'step' value for the time. Choose one of the following valid values: c('1d', '1h', '30m','15m','5m','1m','current'). |
start_time |
the start time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. It is recommended that the |
end_time |
the end time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. OPTIONAL if timestep is 'current' or if the user desires to get the maximum results possible (depends on the timestep chosen). |
climacell_wind
returns a tibble that consists of wind related variables (returned values are in metric units) using the Climacell API. These variables consist of wind speed, wind gust, and wind direction.
a tibble
## Not run: climacell_wind( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = 'current') ## End(Not run)
## Not run: climacell_wind( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = 'current') ## End(Not run)
this is a helper function that returns the moon phase tibble containing the moon phase codes (which are returned by Climacell API) and their appropriate description.
dict_moonphase()
dict_moonphase()
a tibble
this is a helper function that returns the precipitation type tibble containing the precipitation type codes (which are returned by Climacell API) and their appropriate description.
dict_preciptype()
dict_preciptype()
a tibble
this is a helper function that returns the weather code tibble containing the weather codes (which are returned by Climacell API) and their appropriate description.
dict_weathercode()
dict_weathercode()
a tibble