View source: R/get_weather_data.R
get_weather_data | R Documentation |
This function loads weather data which is used to forecast the mid-term load seasonalities. First the 20 most populated areas in the country are obtained from https://wft-geo-db.p.rapidapi.com . Then the closest weather stations of each area are identified and average daily temperature values are downloaded from https://meteostat.p.rapidapi.com for the provided time period. From this data a weighted daily average temperature based on population is calculated for the provided country.
get_weather_data(
midterm_demand_data,
api_key = "default",
data_directory = tempdir()
)
midterm_demand_data |
Dataframe. The mid-term data series from |
api_key |
Character. A valid API key from rapidapi that is subscribed to wft-geo-db and meteostat. If set to "default", one of the deposited keys will be used. |
data_directory |
The path to the directory where the data will be saved. |
A list containing the mid-term data and temperature data.
See function decompose_load_data
for the generation of the mid-term series.
example_midterm_demand_and_weather_data <- get_weather_data(example_midterm_demand_data,
api_key = "default"
)
head(example_midterm_demand_and_weather_data$demand)
head(example_midterm_demand_and_weather_data$temperature_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.