Skip to content

Repository to hold function for retrieving climate data (currently only CHELSA clim). Migrate later to new repo.

Notifications You must be signed in to change notification settings

MirzaCengic/climatedata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

climatedata package

Working with climatedata

To install the package run:

devtools::install_github("mirzacengic/climatedata")

List of functions:

  • get_chelsa() -- download current or future climatic layers for CHELSA climate.
  • check_models() -- retrieve a list of available models and RCP scenarios for future climate.

This package currently contains a function for downloading CHELSA climate data. It can download past, current, and future scenarios for bioclim data. Other variables and other climate datasets will be implemented later.

To retrieve WorldClim data, use raster::getData() function.

Note to self: there was some activity related with this in "https:/gndaskalova/grabr", but the project isn't going anywhere now it seems...


NOTE: This package relies on the archive package for extracting 7zip files. This package is not available on CRAN, so please install the development version in order to use climatedata package.

devtools::install_github("jimhester/archive")

Usage:

library(climatedata)
library(tidyverse)
library(archive)
# Get models with all 4 RCP scenarios
models_all_rcp <- check_models() %>% 
group_by(model) %>%
  mutate(n = n()) %>%
  ungroup() %>%
  filter(n == 4) %>%
  distinct(model) %>%
  pull()

my_output_directory <- "/vol/milkunarc/mcengic/Data_RAW/CHELSA/Future_2050"


chelsa_bioclim <- get_chelsa(output_dir = my_output_directory, period = "future",
                             future_years = "2041-2060", scenario_string = "rcp85",
                             model_string = models_all_rcp, return_raster = FALSE)

Important - get_chelsa() function only works on UNIX system with 7z installed. Figure out how to unzip .7z files without using external software (if possible).

Meanwhile, get_chelsa() function was updated to use archive::archive_extract() function.


About

Repository to hold function for retrieving climate data (currently only CHELSA clim). Migrate later to new repo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages