handle_NAs: Apply 'napredict' carefully

View source: R/bounded_values.R

handle_NAsR Documentation

Apply napredict carefully

Description

Apply napredict carefully

Usage

handle_NAs(x, na.index, na.act)

Arguments

x

a vector, data frame, or matrix to be adjusted based upon the missing value information.

na.index

An object that has a length greater than 0 if NAs are present in x.

na.act

An object produced by a na.action function.

See Also

napredict

Examples

x <- c(3, NA, 2, NA, 4)
# Compare
cumsum(x)

x2 <- stats::na.exclude(x)
handle_NAs(cumsum(x2), anyNA(x), attr(x2, "na.action"))


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