Skip to content

This repository hosts all code for the R-package "rainmapr". rainmapr can be used to download CHIRPS raster data on precipitation.

Notifications You must be signed in to change notification settings

DavidDHofmann/rainmapr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rainmapr

rainmapr is an R-package that allows you to download CHIRPS data in raster format. At the moment, data can only be downloaded globally. Data is available at 0.25 and 0.05 degrees resolution and either as daily or monthly averaged product.

Installation

You can install the development version of rainmapr from GitHub with:

# install.packages("devtools")
devtools::install_github("DavidDHofmann/rainmapr")

Example

Here is a little example how you can download data

# Load required packages
library(terra)
library(rainmapr)

# Download chirps data
chirps_files <- getCHIRPS(
    tres      = "monthly"
  , sres      = 0.05
  , dates     = c("2020-06-01", "2020-12-01")
  , dsn       = tempdir()
  , overwrite = T
)

# Load data into the r session
r <- rast(chirps_files)

# Reclassify values for easier plotting
r <- classify(r, rcl = cbind(-Inf, 0, NA))

# Visualize
plot(r, nr = 2)

About

This repository hosts all code for the R-package "rainmapr". rainmapr can be used to download CHIRPS raster data on precipitation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages