📜  R删除逗号 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:39.644000             🧑  作者: Mango

代码示例1
> df <- data.frame(numbers = c("123,456,789", "1,234,567", "1,234", "1"))
> df
      numbers
1 123,456,789
2   1,234,567
3       1,234
4           1
> df$numbers <- as.numeric(gsub(",","",df$numbers))
> df
    numbers
1 123456789
2   1234567
3      1234
4         1