kenhanscombe / ukbtools

An R package to manipulate and explore UK Biobank data
https://kenhanscombe.github.io/ukbtools/
96 stars 26 forks source link

ukb_df, Error in data.table::fread, unused argument #10

Closed kenhanscombe closed 6 years ago

kenhanscombe commented 6 years ago

Dear Ken,

I am using your ukbtools package to process the UK Biobank data downloaded. The ukb_df_field() function works fine but I came across the following strange problem with the ukb_df() function:

> library(devtools)
> devtools::install_github("kenhanscombe/ukbtools", dependencies = TRUE)
> library(ukbtools)
> my_ukb_data <- ukb_df("ukb23009")
Error in data.table::fread(input = tab_location, sep = "\t", header = TRUE,  : 
  unused argument (nThread = if (n_threads == "max") {
    parallel::detectCores()
} else if (n_threads == "dt") {
    data.table::getDTthreads()
} else if (is.numeric(n_threads)) {
    min(n_threads, parallel::detectCores())
})

The problem appeared both linux and mac environments. Would be great if you could help!

Thanks in advance

Wenhua

kenhanscombe commented 6 years ago

Hi Wenhua,

What version of data.table are you using? (use sessionInfo(), or ?data.table and scroll to the bottom of the documentation). You need a fairly recent version that includes the nThread argument. Perhaps update data.table and let me know if that works.

All the best,

Ken

weiwedin05 commented 6 years ago

Spot on Ken! The data.table version I used was data.table_1.10.4-3. Updating to the latest version fixed the problem. Thanks again. Wenhua

kenhanscombe commented 6 years ago

Thanks, Wenhua.