Skip to contents

Convert counts into fractions of total counts, dealing with zero sum counts by setting to zero instead of Inf

Usage

compute_fraction_from_count(counts)

Arguments

counts

a numeric vector of counts

Value

a numeric vector of fractions

Details

Uses absolute value of counts for computing fractions.

Examples

compute_fraction_from_count(c(10, 2, 1000, 50, 250))
#> [1] 0.007621951 0.001524390 0.762195122 0.038109756 0.190548780