[datatable-help] New function fread() in v1.8.7

Matthew Dowle mdowle at mdowle.plus.com
Mon Dec 24 14:52:44 CET 2012


Great. Looks like cols 3,4,9 and 12 are being detected as integer64 ok 
(16 width is just about ok, limit is 18 digits for integer64), but later 
on in the file there is a . or more digits in one of those columns that 
causes the bump to real. There is a nice message telling you which line 
and which field and the contents is causing the bump,  but the 
'unimplemented' error happens first. oops,  will fix ..

Thanks!


On 24.12.2012 12:21, akhilsbehl wrote:
> Here is a new problem:
>
> I have a csv that looks like this:
>
> 
> PO,CASH,2012080150000306,67389310793869,bbRELIANCE,EQ,74025,700,2012080150004326,1,3,2012080150001143,1,3
> 
> PO,CASH,2012080150000307,67389310793884,bbRELIANCE,EQ,74025,2000,2012080150007969,1,3,2012080150001143,1,3
> 
> PO,CASH,2012080150000308,67389310793896,bbRELIANCE,EQ,74025,1000,2012080150002222,1,3,2012080150001143,1,3
>
> read.csv(filename) gives me:
>
> 1 PO CASH 2.01208e+15 6.738931e+13 bbRELIANCE EQ 74025   700
> 2.01208e+15   1
> 3 2.01208e+15   1   3
> 2 PO CASH 2.01208e+15 6.738931e+13 bbRELIANCE EQ 74025  2000
> 2.01208e+15   1
> 3 2.01208e+15   1   3
> 3 PO CASH 2.01208e+15 6.738931e+13 bbRELIANCE EQ 74025  1000
> 2.01208e+15   1
> 3 2.01208e+15   1   3
>
> fread(filename, verbose=TRUE) gives me:
>
> Detected eol as \n only (no \r afterwards), the UNIX and Mac 
> standard.
> Starting format detection on line 30 (the last non blank line in the 
> first
> 30)
> Detected sep as ',' and 14 columns
> Type codes: 33113300100100
> Found first row with 14 fields occuring on line 1 (either column 
> names or
> first row of data)
> The first data row has some non character fields. Treating as a data 
> row and
> using default column names.
> Count of eol after pos: 54025
> Subtracted 1 for last eol and any trailing empty lines, leaving 54024 
> data
> rows
>
> Error in fread(data.files[[2]], verbose = TRUE) :
>   Coercing integer64 to real needs to be implemented
>
> Type codes show it is trying to read columns 3, 4, 9, 12 as real 
> numbers.
> Now, I may be out of depth here but shouldn't they just be integers? 
> Am I
> missing something?
>
> Thanks.
>
> --
> ASB.
>
>
>
> --
> View this message in context:
> 
> http://r.789695.n4.nabble.com/New-function-fread-in-v1-8-7-tp4653745p4653872.html
> Sent from the datatable-help mailing list archive at Nabble.com.
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> 
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help



More information about the datatable-help mailing list