I have a dataframe with a bunch of columns that I need to convert to the numeric type. I have written the following code to try to do this, however it is saying the replacem
Combining the answer by @Andrii with the comment by @RobertYi, my short suggestion is
df[] <- sapply(df, as.numeric)
This ensures that the result stays as data frame.