fun_kLargest: Find the 'k'-largest/smallest values (and apply a function to...

Description Usage Arguments Value

Description

Find the k-largest/smallest values (and apply a function to these values)

Usage

1
2
fun_kLargest(x, largest = TRUE, fun = NULL, k = 10L, na.rm = FALSE,
  ...)

Arguments

x

A numeric vector

largest

A logical value. See return value.

fun

A function which requires one argument or "index". fun will be applied to the k-largest/smallest values of x.

k

An integer value. The k-largest/smallest value(s) of x will be used. The largest/smallest value will be used if 0 or negative.

na.rm

A logical value indicating whether NA values should be stripped before the computation proceeds.

...

Optional arguments to be passed to fun

Value

A vector of length k,

Otherwise, the result of applying fun to the k-largest/smallest values.


Burke-Lauenroth-Lab/SoilWat_R_Wrapper documentation built on May 6, 2019, 8:52 a.m.