Calculate a percentage using the formula \(n * 100 / total\). Rounding is
done by round_ties_away()
.
Arguments
- n, total
Numeric vectors of equal length or with at least one vector of length 1.
- digits
An integer indicating the number of decimal (when positive) or whole number (when zero or negative) places to round the output. (See the same argument in
round_ties_away()
.)- format
Logical indicating if the output should be formatted with a "%" sign and if percentages that round to 0 should be replaced with "< 1%".