Author: Lv Wenjuan
步骤:
1、先将逗号分隔符替换为空格
2、再将空格用正则式替换
> a<-"1,234.2"
> b<-as.numeric(a)
<span style="color:#cc0000;">Warning message:
NAs introduced by coercion
</span>> b<-<strong>chartr</strong>(","," ",a)
> b<-<strong>gsub</strong>("[N ]","",b)
> result<-as.numeric(b)
> result
[1] 1234.2