Reputation: 45
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
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