[datatable-help] Use of int64 with fread

stat quant statquant at outlook.com
Thu Apr 18 16:03:18 CEST 2013


Hi Matthew, I cast int64 to character, I need to use those as keys but
as you pinpoints it is not yet supported, because of it I use strings.
I guess numeric (aka double) could be used but comparing numerics can
be problematic too.
The other usecase is to select stuff, for this case either it is not
well suited as doing DT[myInt64 == 144454938488621444] gives me
myInt64 equals to 144454938488621440, not sure if the problem is how
int64 are displayed or if operator == is different for int64 but
that's too much of a problem to me...

For the fread that's AWESOME news, It will be usefull for datetime
columns, we'll be able to use fasttime on datetime columns! Your way
(the OR case) looks better as if you know the first way you can go to
the second way in a few lines of code. (May be even internally [hint
hint] so we loosers don't have to do anything !!!)

2013/4/18, Matthew Dowle <mdowle at mdowle.plus.com>:
>
> What do you cast integer64 back to?  There is some support, you just
> can't have integer64 in keys for example yet. They can be useful and
> work as a value column don't they?  (I don't have much need for
> integer64 myself, so I don't necessarily know.)
>
> I've added use.integer64 = TRUE as a global option and argument to
> fread (not yet committed). That's just a way to turn off the integer64
> feature basically, so they'll be read as numeric as read.csv does.
>
> Btw, after some to and fro I'm thinking colClasses (when type character
> vector) would work the same as read.csv,  but if type list, then you
> could pass sets of columns by number or name; i.e., two valid ways to
> use colClasses in fread would be :
>
>     colClasses =
> c(colC="character",colD="character",colE="character",colQ="numeric")   #
> as read.csv
> or
>     colClasses = list(character=3:6, numeric="colQ")
>
> To drop columns use "NULL" in colClasses just as read.csv. To select
> columns, 'select' may be either character or numeric vector.
>
> Sound ok?
>
> Matthew
>
>
> On 18.04.2013 10:28, statquant3 wrote:
>> Hello,
>> a quick question.
>> Given that there is no support yet of int64 in data.table operations.
>> Is it really a good thing to cast automatically int64. I find myself
>> casting back int64 all the time...
>>
>> Cheers
>>
>>
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/Use-of-int64-with-fread-tp4664582.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