Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

'split' is not an exported object from 'namespace:data.table'

running data.table::split returns an Error: 'split' is not an exported object from 'namespace:data.table'. Any idea why?

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

split is a generic function defined in base. Package data.table just adds a new "data.table" method to it.

## S3 method for class 'data.table'
split(x, f, drop = FALSE,
      by, sorted = FALSE, keep.by = TRUE, flatten = TRUE,
      ..., verbose = getOption("datatable.verbose"))

You can go for data.table:::split.data.table.


So this behavior is expected? It seems weird to me. Shouldn’t data.table::split point to data.table:::split.data.table?

It might be easier for you to consider print. This is also a generic function. Does every package need to redefine it and make an R session a mess? No. A common practice is to add a new method by defining print.xxx.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading