ratio_to_report: Calculate weight of value in vector: x / sum(x)

Description Usage Arguments Examples

Description

function returns vector where each element represents weight of original value. If sum of original values equal to 0 then result will contain NA values. Please be aware that function may return unexpected result when values in vector are of different sign and sum of them almost equal to zero (e.g. ratio_to_report(c(1, 2, 3, -6.00000001)) will return very big numbers).

Usage

1
ratio_to_report(x, na.rm = FALSE)

Arguments

x

vector of numbers

na.rm

remove NA values

Examples

1
pacta::ratio_to_report(c(1, 2, 3, NA, 5), na.rm = TRUE)

2DegreesInvesting/pacta documentation built on June 17, 2019, 12:04 p.m.