View source: R/getClimateWizard_scenarios.R
getClimateWizard_scenarios | R Documentation |
This function is a wrapper for the getClimateWizardData function to access climate scenario data for a location of interest. Climate model runs are queried and data returned and summarized according to the specified parameters. A number of metrics are available for several climate models, which are listed in https://github.com/CIAT-DAPA/climate_wizard_api. This function can download data for multiple climate scenarios, saving users the effort to retrieve them separately.
getClimateWizard_scenarios(
coordinates,
scenarios,
start_years,
end_years,
baseline = c(1950, 2005),
metric = "monthly_min_max_temps",
GCMs = "all"
)
coordinates |
position of the point of interest, specified by a vector with two elements that are called longitude and latitude (e.g. c(longitude=10, latitude=20)). |
scenarios |
vector of representative concentration pathway scenarios. Can only be "historical", "rcp45" or "rcp85". |
start_years |
vector of start year of the intervals, for which data is to be summarized. Must be of same length as scenarios. |
end_years |
vector of end years of the intervals, for which data is to be summarized. Must be of same length as scenarios. |
baseline |
numeric vector of length 2 indicating the time interval to be used as baseline for the climate scenario. The function then returns projected values relative to this baseline. Defaults to c(1950,2005) for the standard baseline of the ClimateWizard dataset. This can also assume different values, but it must span an interval of at least 20 years within the [1950; 2005] interval. Needs to be set to NA for the function to return absolute values. |
metric |
vector of metrics to output, from a list specified in the reference provided above. This can also be "monthly_min_max_temps", which returns all mean monthly minimum and maximum temperatures, or "precipitation" for precipitation data for all months, or "monthly_tmean" for the mean monthly temperatures of all months. |
GCMs |
vector of GCMs to be accessed, from a list specified in the above reference. This can also be "all" for all available GCMs (as of January 2018). |
Note that this function lacks quality checks. If something goes wrong, you may consider checking individual scenarios with the getClimateWizardData function.
data.frame containing the requested information.
Eike Luedeling
Girvetz E, Ramirez-Villegas J, Navarro C, Rodriguez C, Tarapues J, undated. ClimateWizard REST API for querying climate change data. https://github.com/CIAT-DAPA/climate_wizard_api
#example is #d out, because of runtime issues.
#getC<-getClimateWizard_scenarios(coordinates=c(longitude=6.99,latitude=50.62),
# scenarios=c("rcp85","rcp45"),
# start_years=c(2070,2035),
# end_years=c(2100,2065),
# metric=c("monthly_tmean"),
# GCMs=c("all"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.