Batch convert columns to numeric type

前端 未结 6 2115
眼角桃花
眼角桃花 2021-01-01 11:20

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

6条回答
  •  春和景丽
    2021-01-01 11:53

    A fast a dirty way to do it, especially if you have variables all over that need converting, which would mean a lot of conversion code is to write the file out and read it back in again using something like write.csv/read.csv

    write.csv(regmodel, file="regmodel.csv")
    read.csv(file="regmodel.csv")
    

提交回复
热议问题