sd_i: Sample Standard Deviation for Integer Values

Description Usage Arguments Value Examples

View source: R/sd_i.R

Description

Written in C++, this function should always run faster than sd for integer vectors. Not valid for non-integer vectors.

Usage

1
sd_i(x)

Arguments

x

Integer vector.

Value

Numeric value.

Examples

1
2
3
4
# For integer vectors, var_i is typically much faster than var.
x <- rpois(1000, lambda = 5)
all.equal(sd(x), sd_i(x))
benchmark(sd(x), sd_i(x), replications = 2000)

dvmisc documentation built on May 2, 2019, 5:51 p.m.