prop_distinct {campfin}R Documentation

Proportion missing

Description

Find the proportion of values of x that are distinct.

Usage

prop_distinct(x)

Arguments

x

A vector to check.

Details

length(unique(x))/length(x)

Value

The ratio of distinct values x to total values of x.

See Also

Other counting wrappers: count_diff(), count_in(), count_na(), count_out(), na_in(), na_out(), na_rep(), prop_in(), prop_na(), prop_out(), what_in(), what_out()

Examples

prop_distinct(c("VT", "VT", NA, "ME"))

[Package campfin version 1.0.11 Index]