moments_n: Compute moments

View source: R/utilities.R

moments_nR Documentation

Compute moments

Description

Returns a function that will return uncentered moments

Usage

moments_n(orders, cols = NULL)

Arguments

orders

Numeric with the order of the uncentered moments that will be computed.

cols

Character vector with the name of the columns of the data for which moments will be computed. If NULL, will use all columns.

Value

A function that takes a data.frame and return a named numeric vector of the uncentered moments of the columns.

See Also

Other helper functions: delayed_with(), densify(), draw_data(), mean_dist_to_sf(), mean_dist_to(), mean_self_proximity(), truncate_to()

Examples

data <- data.frame(x = rnorm(100), y = rnorm(100))
moments_3 <- moments_n(1:3)

moments_3(data)

moments_3 <- moments_n(1:3, "x")
moments_3(data)


metamer documentation built on June 24, 2022, 1:06 a.m.