convert_precipitation: Converts units of precipitation data

View source: R/units.R

convert_precipitationR Documentation

Converts units of precipitation data

Description

Converts units of precipitation data

Usage

convert_precipitation(
  x,
  unit_from,
  unit_to = c("cm day-1", "cm month-1", "cm/day", "cm/month"),
  dpm = NA
)

Arguments

x

A numeric object. Precipitation data in units of unit_from.

unit_from

A character string. Units of data in x. Currently, supported units include "mm/month", "mm month-1", "mm/d", "mm d-1", "kg/m2/s", "kg m-2 s-1", "mm/s", "mm s-1", "cm/month", "cm month-1".

unit_to

A character string. Units to which data are converted. Currently, supported unit are "cm day-1", "cm month-1" and respectively "cm/day", "cm/month".

dpm

A numeric object. Number of days per month in the time series x. Only used if one of the units is on a monthly time scale.

Value

A numeric object of the same size as x in units of unit_to.


DrylandEcology/rSW2utils documentation built on Dec. 9, 2023, 10:44 p.m.