percent: Percent of TRUE values

View source: R/percent.R

percentR Documentation

Percent of TRUE values

Description

Returns percentage of the occurance of TRUE values in a vector of logical values.

Usage

percent(x, round = 2, min_valid, max_na)

Arguments

x

A vector

round

Demical positions (default = 2).

min_valid

Minimal number of valid values that is required for calculation. A value between 0 and 1 indicates a proportion of values (e.g., 0.5 = 50 percent of values have to be valid).

max_na

Maximum number of NAs that are allowed before returning NA. A value between 0 and 1 indicates a proportion of values (e.g., 0.5 = 50 percent NAs are allowed).

Value

A percentage

Examples

percent(runif(10000) > 0.50)

jazznbass/wmisc documentation built on Oct. 29, 2024, 5:42 p.m.