[R-pkg-devel] Using data.table in a package

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Fri Mar 5 15:22:34 CET 2021


Martin,

Both questions are FAQs. Searches at e.g. StackOverflow might have lead you
to a solution (and you can search there, key is to add the tag i.e. make [r]
or [data.table] part of the search term).

The first one is a generic package programming question. You can use Imports:
in DESCRIPTION along with import() or importFrom() in NAMESPACE. Plenty of
tutorials.

The second one is more data.table specific and, per a quick glance, not
directly covered in the data.table FAQ---but it has a link to
https://stackoverflow.com/questions/10527072/using-data-table-package-inside-my-own-package

It's a "tax" on package writing (that I grudgingly but happily) pay because
it makes the indexing operations _so much easier_ than data.frame use by
having non-standard evaluation just inside the [] operator as Duncan alluded
to. Which is, to me, another one of the quietly cool features in data.table.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list