Code Monkey home page Code Monkey logo

climatedata's Introduction

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://github.com/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.


climatedata's People

Contributors

mirzacengic avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.