oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
623 stars 64 forks source link

read.csv treat column as character instead of number if missing value after valid value #42

Closed comicfans closed 5 years ago

comicfans commented 5 years ago

read following csv

col1,col2
,1
2,

with

csv <-read.csv('test.csv',stringsAsFactors=F)
typeof(csv$col1)
csv$col1
typeof(csv$col2)
csv$col2

GNU-R

integer
NA 2
integer
1 NA

fastR

integer
NA 2
character
"1"  ""

seems this only happen if missing value after valid value. for example add more row like this:

col1,col2
,1
2,
,3

fastR typeof col1 will also changed to character

steve-s commented 5 years ago

Hi comicfans,

thanks for the report, we can reproduce and are working on a fix.

steve-s commented 5 years ago

Should be fixed in ce2ee00e011fd0e888ba52b283ca64d7db900095