aggregate_rainfall: Get the summed yearly rainfall

Description Usage Arguments

View source: R/get_yearly_rainfall.R

Description

This function takes either a polygon, or nothing (than it's pixel based) and calculates the sum of rainfall for each polygon (each pixel) for each year

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
aggregate_rainfall(
  path_ncdf = "/mnt/CEPH_PROJECTS/Proslide/PREC_GRIDS_updated/",
  polygon = NULL,
  years = 1980:2018,
  by = "year",
  daily_fun = NULL,
  monthly_fun = NULL,
  return.list = FALSE,
  aggre_fun = "mean"
)

Arguments

return.list

if True it will return a list of stars oject. If false will return one stars object (if by = year), and a list of stars-objects if by = 'month'

aggre_fun

If you pass a polygon, the values need to be aggregated somehow

fun

How to combine the individual values. E.G. the mean for each pixel for the years 1980, 1981 and 1982 requires the the fun to be "mean". The maximum value for each month in the years 80,81,82 requires the by-parameter to be month and the fun-parameter to be max


RobinKohrs/rainfallR documentation built on Oct. 3, 2021, 1:42 a.m.