Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Missing value treatment in the dataset

$
0
0

@anilkumarqa86 wrote:

Hi
I am working with attached dataset for linear regression problem and have performed the below steps :

dataset<- read.csv("LinearRegressionCase.csv")
View(dataset)
summary(dataset)

Function to replace #NULL with NA

nullrep<-function(x){
ifelse(x=="#NULL!",NA,x)

}

df<- as.data.frame(apply(dataset,2,nullrep))
summary(df)

Now I need to replace NA with mean or 0 value but for me it is throwing error saying that it needs to be converted to numeric...

Please help me out in removing the NAs (using function) and converting the variables to numeric.

Posts: 9

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles