vec_math

0th

Percentile

Mathematical operations

This generic provides a common dispatch mechanism for all regular unary mathematical functions. It is used as a common wrapper around the Summary group generics, the Math group generics, and a handful of other mathematical functions like mean().

Keywords
internal
Usage
vec_math(fun, x, ...)

vec_math_base(fun, x, ...)

Arguments
fun

An mathematical function as a string

x

A vector

...

An additional arguments.

Details

vec_base_arith() is provided as a convenience for writing methods. It calls the base fun on the underlying vec_data().

Included functions

  • From the Summary group generic: max(), min(), range(), prod, sum(), any(), all().

  • From the Math group generic: abs(), sign(), sqrt(), ceiling(), floor(), trunc(), cummax(), cummin(), cumprod(), cumsum(), log(), log10(), log2(), log1p(), acos(), acosh(), asin(), asinh(), atan(), atanh(), exp(), expm1(), cos(), cosh(), cospi(), sin(), sinh(), sinpi(), tan(), tanh(), tanpi(), gamma(), lgamma(), digamma(), trigamma().

  • Additional generics: mean(), is.nan(), is.finite(), is.infinite().

See Also

vec_arith() for the equivalent for the arithmetic infix operators.

Aliases
  • vec_math
  • vec_math_base
Examples
# NOT RUN {
x <- new_vctr(c(1, 2.5, 10))
x

abs(x)
sum(x)
cumsum(x)
# }
Documentation reproduced from package vctrs, version 0.1.0, License: GPL-3

Community examples

Looks like there are no examples yet.