How can I change the value 20,000 to 20000 in R? In my case, I have a CSV file where column A is a value with format xx,xxx and column B is a group name.
So
data[,1]
[1] 203,472.40 226,433.70 ...
100 Levels: 101,051.40 103,662.70 ...
The numerical value is a factor instead of numeric.
I to convert data[,1] to
[1] 203472.40 226433.70 ...
I've tried as.numeric, but this doesn't work with factors.
dec=",", which will read data as numeric values (comma will separate decimals) and then you can multiple them by1000to get the correct valuesread.csv('path.to.file', dec=',')