Data.table: Fread warning

Created on 7 May 2019  路  8Comments  路  Source: Rdatatable/data.table

When I run fread first time, I get error,

ff <- fread(paste0("C:/tmp/dataset.csv.gz"),
sep = "|", dec = ".", stringsAsFactors = FALSE,
encoding = "UTF-8")
Registered S3 method overwritten by 'R.oo':
method from
throw.default R.methodsS3

fread

Most helpful comment

Confirming. This is _not_ on data.table. It's related to R.oo/R.methodsS3 and is a note that is produced in R (>= 3.6.0). Despite being annoying - it should be a harmless note. I'll investigate how to avoid it, but it'll most likely require a few release cycle of the two, so don't expect anything soon.

All 8 comments

please share your sessionInfo() and confirm your error reproduces after running it in an R --vanilla terminal session

it doesn't seems to be related to data.table directly, both packages R.oo and R.methodsS3 are defining same method throw.default resulting a warning
https://cran.r-project.org/web/packages/R.methodsS3/R.methodsS3.pdf
https://cran.r-project.org/web/packages/R.oo/R.oo.pdf
any idea if we can do something with that @HenrikBengtsson

Confirming. This is _not_ on data.table. It's related to R.oo/R.methodsS3 and is a note that is produced in R (>= 3.6.0). Despite being annoying - it should be a harmless note. I'll investigate how to avoid it, but it'll most likely require a few release cycle of the two, so don't expect anything soon.

Thanks for checking. I think we can then safely close this here.

I came here from https://github.com/HenrikBengtsson/R.utils/issues/95

Can @jangorecki (or anyone else) you please explain this warning appears for data.table? data.table imports methods, which is part of core R as far as I can tell, but where is the dependency / invocation of R.oo or R.methodsS3?

@geneorama We suggests R.utils (which uses R.oo and R.methodsS3), and just checking if it is available with requireNamespace loads that namespace, thus emit the warning. The same could happen for first, last where we checked xts namespace: https://github.com/Rdatatable/data.table/issues/3857

@jangorecki Thanks.

It's interesting that CRAN let something happen that introduced this issue. I guess it's because it's not an error or warning, it's just a message. Otherwise I think the checks would have caught it?

For all the inconvenience of the CRAN checks, I would have thought it would prevent this!

Also, it's weird that if I step through the function using debug(requireNamespace) I don't get the warning. I still can't tell what line exactly is causing this message. I was hoping that quiet=TRUE would suppress the message, but from your linked pull request for xtx::First that the quiet option didn't help.

What an annoying problem. I think it makes data.table look a little bad, even though it's not data.table.

@geneorama It is just another example why it make sense to avoid dependencies, even those in Suggests.

Was this page helpful?
0 / 5 - 0 ratings