knitr::opts_chunk$set(echo = TRUE)
First update pastclim
to the latest commit in branch chelsa
. Close RStudio and restart it
before trying this out.
We now have a lot of new dataset. Let's try a couple of variables to check that they all work
library(pastclim) list_available_datasets()
Start with a virtual dataset:
bio_vars <- c("bio12","temperature_01") dataset = "CHELSA_2.1_0.5m_vsi" download_dataset(dataset=dataset, bio_variables = bio_vars)
Now use it:
test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$bio12 test_rast$temperature_01
NOTE: bio12 is precipitation (it should go into the several thousands), whilst temperature_01 is the Jan temp (so range, from -50 to 40 or something along those lines depending on which dataset you are looking at). Ideally, the units should be informative.
Now the real dataset (downloading the files)
bio_vars <- c("bio12","temperature_01") dataset = "CHELSA_2.1_0.5m" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$bio12 test_rast$temperature_01
Again, a virtual dataset first
bio_vars <- c("bio12","temperature_01") dataset = "CHELSA_2.1_MPI-ESM1-2-HR_ssp370_0.5m_vsi" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$bio12 test_rast$temperature_01
And now the downloading data:
bio_vars <- c("bio12","temperature_01") dataset = "CHELSA_2.1_GFDL-ESM4_ssp126_0.5m" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$bio12 test_rast$temperature_01
bio_vars <- c("bio12","bio12") dataset = "paleoclim_1.0_10m" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$bio12 test_rast$bio12
bio_vars <- c("bio01","bio12") dataset = "WorldClim_2.1_10m" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$bio01 test_rast$bio12
bio_vars <- c("temperature_min_03") dataset = "WorldClim_2.1_10m" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$temperature_min_03
bio_vars <- c("altitude") dataset = "WorldClim_2.1_10m" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$altitude
Future projections
bio_vars <- c("bio01","bio12") dataset = "WorldClim_2.1_MPI-ESM1-2-HR_ssp370_10m" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$bio01 test_rast$bio12
bio_vars <- c("bio06") dataset = "CHELSA_trace21k_1.0_0.5m_vsi" download_dataset(dataset=dataset, bio_variables = bio_vars) test_rast<-region_series(bio_variables = bio_vars, dataset = dataset) test_rast$bio06
Don't plot this series, it has over 200 remote time steps, with each time step hundreds of megabytes in size. But you could try etracting climate for a couple of points:
locations <- data.frame( name = c("Iho Eleru", "La Riera", "Chalki", "Oronsay", "Atlantis"), longitude = c(5, -4, 27, -6, -24), latitude = c(7, 44, 36, 56, 31), time_bp = c(-11200, -18738, -10227, -10200, -11600) ) location_slice( x = locations, bio_variables = c("bio06"), dataset = "CHELSA_trace21k_1.0_0.5m_vsi", nn_interpol = FALSE )
Note that, since CHELSA trace21k includes the ocean, we get estimates for every single point!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.