Learn R Programming

TSDT (version 1.0.0)

na2empty: na2empty

Description

Replace all instances of NA in character variable with empty string.

Usage

na2empty(x)

Arguments

x

A character vector.

Value

A character vector with NA values replaced with empty string.

See Also

unfactor

Examples

Run this code
# NOT RUN {
## Create character variable with missing values
ex1 <- c( 'A', NA, 'B', NA, 'C', NA )
ex1

## Replace NAs with empty string
ex1 <- na2empty( ex1 )
ex1
# }

Run the code above in your browser using DataLab