as.numeric with comma decimal separators?

前端 未结 7 1706
野性不改
野性不改 2020-11-27 04:32

I have a large vector of strings of the form:

Input = c(\"1,223\", \"12,232\", \"23,0\")

etc. That\'s to say, decimals separated by commas,

7条回答
  •  醉话见心
    2020-11-27 05:20

    As stated by , it's way easier to do this while importing a file. Thw recently released reads package has a very useful features, locale, well explained here, that allows the user to import numbers with comma decimal mark using locale = locale(decimal_mark = ",") as argument.

提交回复
热议问题