prop_matching: Calculate the percent of non-missing values in a character...

View source: R/factorize.R

prop_matchingR Documentation

Calculate the percent of non-missing values in a character vector containing the values of interest. This is a helper function for factorize_df().

Description

Calculate the percent of non-missing values in a character vector containing the values of interest. This is a helper function for factorize_df().

Usage

prop_matching(vec, valid_strings, ignore.case = FALSE)

Arguments

vec

character vector.

valid_strings

the values that the variable can possibly take on.

ignore.case

if TRUE, ignores case in matching

Value

a numeric proportion between 0 and 1.


tntp/tntpr documentation built on March 27, 2024, 6:26 p.m.