Closed ccsarapas closed 1 year ago
Thanks. In my opinion, this should be the responsibility of the data.table package. This package can implement an as_tibble.data.table()
method without pulling in a strong dependency on tibble.
@hadley: Where do we document which packages should implement which methods? I haven't found it in https://design.tidyverse.org/ . Should this be a chapter or a paragraph somewhere?
s3_register()
and others)
R Packages has some coverage of these matters:
https://r-pkgs.org/dependencies-in-practice.html#imports-and-exports-related-to-s3
... An add-on package that implements an S3 generic for a new class should list the generic-providing package in Imports, import the generic into its namespace, and export its S3 method....
Which does support your proposal that an as_tibble()
method for data.table
would naturally be implemented by the owner of the data.table
class. The section goes on to talk about conditional registration, if you list the generic-owning package in Suggests
instead of Imports
, and s3_register()
.
Thanks, @jennybc, for the pointer!
@ccsarapas: Can you please take this to the data.table issue tracker if needed?
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
Would you consider adding a data.table method to
as_tibble()
? On extremely cursory testing, it may be as simple as adaptingas_tibble.data.frame()
with an extra line to remove the.internal.selfref
attribute:Created on 2023-09-22 with reprex v2.0.2