I'm using the data.table package in R. When trying to use setkey on a numeric column, I'm getting the following error message:
setkey(candidate.SNPs.MAF, p)
Error in setkeyv(x, cols, verbose = verbose) :
Column 'p' cannot be coerced to integer without losing fractional data.
I've seen a recent answer that suggests I need to have at least v1.8.1 and have confirmed that this problem occurs when using the newest version (1.8.2)
help(package="data.table")
Information on package 'data.table'
Description:
Package: data.table
Version: 1.8.2
Any suggestions? I'd rather not have to revert to data.frames.
My data structure looks like this:
str(can_SNPs_context)
Classes 'data.table' and 'data.frame': 1031 obs. of 23 variables:
$ Trait : chr "GH2_SLA" "GH2_SLA" "GH2_SLA" "GH2_SLA" ...
$ Locus : chr "1" "1" "1" "1" ...
$ Marker : int 1825530 1844004 2251065 2444826 2832616 3557976 4299 650 4606939 4610965 6057450 ...
$ p : num 8.68e-08 7.21e-08 1.11e-07 1.20e-08 8.17e-08 ...
The p column is the one I'm trying to set as the key - do the very small values cause the problem?
R version 2.15.1 Linux x86_64
Thanks!