mark_na: Mark Values as NA

Description Usage Arguments Value Examples

View source: R/mark_na.R

Description

This function makes it easier to convert values to missing (NA).

Usage

1
mark_na(x, term, drop = T)

Arguments

x

A vector of factor data to convert to a dummy.

term

A vector of terms to recode as 1.

drop

Drop missing levels? Defaults to TRUE.

Value

A vector of data, with missing data marked as NA.

Examples

1
2
x <- sample(c("Coffee", "Tea", "Hot Chocolate"), replace = TRUE, size = 100)
mark_na(x, term = "Coffee")

jackobailey/jbmisc documentation built on Dec. 14, 2021, 12:11 a.m.