Learn R Programming

tsensembler (version 0.0.5)

proportion: Computing the proportions of a numeric vector

Description

Utility function used to compute the proportion of the values of a vector. The proportion of a value is its ratio relative to the sum of the vector.

Usage

proportion(x, ...)

Arguments

x

a numeric vector;

...

Further arguments to var and sum function (e.g. na.rm = TRUE)

Value

A vector of proportions

Examples

Run this code
# NOT RUN {
proportion(rnorm(5L))
proportion(1:10)

# }

Run the code above in your browser using DataLab