fun_no_na: Perform an operation on a vector that may be empty or all NA...

View source: R/fun_no_na.R

fun_no_naR Documentation

Perform an operation on a vector that may be empty or all NA with controlled output.

Description

Perform an operation on a vector that may be empty or all NA with controlled output.

Usage

fun_no_na(x, FUN, zero_len = NULL)

max_no_na(x, zero_len = NA)

min_no_na(x, zero_len = NA)

median_no_na(x, zero_len = NA)

mean_no_na(x, zero_len = NA)

sd_no_na(x, zero_len = NA)

Arguments

x

The object to perform the operation on.

FUN

The function to perform if the object is neither zero length or all NA

zero_len

If x has length 0, then either return it (if NULL) or return NA of the same class as x (if NA)

Value

An object of the same class as x

Functions

  • max_no_na(): Maximum

  • min_no_na(): Minimum

  • median_no_na(): Median

  • mean_no_na(): Median

  • sd_no_na(): Median

Examples

min_no_na(c(NA, 3))
min_no_na(double(), zero_len=NULL)
max_no_na(c(NA, 3))

billdenney/bsd.report documentation built on Jan. 16, 2024, 12:54 a.m.