Learn R Programming

xda (version 0.2)

removeSpecial: Replaces special characters in your data frame to NA

Description

Replaces special characters in your data frame to NA

Usage

removeSpecial(df, vec)

Arguments

df

name of your data frame

vec

vector containing the special characters you want to replace with NA

Value

Returns the modified data frame

Examples

Run this code
# NOT RUN {
data(iris)
iris[1,2]<-"?"
iris[2,2]<-"@"
iris[3,2]<-"???"
iris<-removeSpecial(iris,c("@","???"))
head(iris)
# }

Run the code above in your browser using DataLab