empty_as_na: replace empty ("") values with "NA"

View source: R/misc_helpers.R

empty_as_naR Documentation

replace empty ("") values with "NA"

Description

"NA" are often easier to see and deal with compared to empty values. Further testing is needed for this function

Usage

df 

  # or

  empty_as_na(df)

Arguments

df

the dataframe or tibble to be modified

Value

df with empty values replaced with "NA"

Examples

## Not run: 
require(tibble)

col1 <- seq(1, 10, 1)
col2 <- c("", 3, 4, "", 6, 7, 8, "", 10, "")
my_df <- tibble(col1 = col1, col2 = col2)
empty_as_na(df = my_df)

## End(Not run)

tknoch8/helpRs documentation built on May 11, 2022, 9:34 p.m.