Learn R Programming

tntpr (version 1.2.1)

prop_matching: 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)

Value

a numeric proportion between 0 and 1.

Arguments

vec

character vector.

valid_strings

the values that the variable can possibly take on.

ignore.case

if TRUE, ignores case in matching