as.numeric用逗号分隔符?
这个问题在这里已经有了答案:
as.numeric(sub(",", ".", Input, fixed = TRUE))
应该管用。
scan(text=Input, dec=",")
## [1]  1.223 12.232 23.000
  但这取决于你的矢量有多长。  我使用rep(Input, 1e6)来创建一个长矢量,并且我的机器挂起。  1e4 , 1e4很好。  @ adibender的解决方案要快得多。  如果我们运行在1e4上,速度要快很多: 
Unit: milliseconds
         expr        min         lq     median         uq        max neval
  adibender()   6.777888   6.998243   7.119136   7.198374   8.149826   100
 sebastianc() 504.987879 507.464611 508.757161 510.732661 517.422254   100
  另外,如果您正在读取原始数据,则read.table和所有相关函数都有一个dec参数。  例如: 
read.table("file.txt", dec=",")
  当所有其他都失败时, gsub和sub是你的朋友。 
