Hemant Sain
Hemant Sain

Reputation: 45

How to Deal with 'Impute" data type after treating missing values with Hmisc in R

I used Hmisc package to impute my missing values and after replacing back in data frame i noticed that my variable types has changed in some "impute" type which is not recognised by many algorithms and i can not feed my data. I want to get rid of this 'Impute' type of variable class and change my variable classes to back to normal data types like factors and integer. already tried as.factors and as.integerbut nothing happened.

Upvotes: 1

Views: 338

Answers (1)

Ronak Shah
Ronak Shah

Reputation: 389175

Try using type.convert which would convert the data to appropriate classes automatically.

df <- type.convert(df)

There is also type_convert in readr which works in similar way.

readr::type_convert(df)

Upvotes: 2

Related Questions