Learn R Programming

TSDT (version 1.0.7)

na2empty: na2empty

Description

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

Usage

na2empty(x)

Value

A character vector with NA values replaced with empty string.

Arguments

x

A character vector.

See Also

unfactor

Examples

Run this code
## 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