A common problem when moving data from excel to R is that excel leaves commas in numbers if the user is not careful. Would it be possible to, as the data is being read through in fread, if the past X rows were numeric and the newest row has a comma, strip the comma and continue with the column being numeric?
I was thinking something similar to this stackoverflow answer
setAs("character", "num.with.commas",
function(from) as.numeric(gsub(",", "", from) ) )
The user could have an option commaNumeric = TRUE such that when true fread will rip commas out of columns it has already declared numeric after the first 30 rows or so.
P.S. thanks for the package, it's really wonderful!
A common problem when moving data from excel to R is that excel leaves commas in numbers if the user is not careful. Would it be possible to, as the data is being read through in fread, if the past X rows were numeric and the newest row has a comma, strip the comma and continue with the column being numeric?
I was thinking something similar to this stackoverflow answer
The user could have an option
commaNumeric = TRUEsuch that when true fread will rip commas out of columns it has already declared numeric after the first 30 rows or so.P.S. thanks for the package, it's really wonderful!