Closed DillonHammill closed 5 years ago
Sorry, I wasn't thinking - this is obviously adding a new method to the as.data.table
generic in the data.table
package. I am assuming that it cannot be directly accessed from openCyto
because the generic is defined in the data.table
package. As long as data.table and openCyto are loaded a call to as.data.table
on objects of class gatingTemplate will work as expected. Just out of curiosity, is there a reason why this was not written as a standalone function (e.g. gatingTemplate_to_datatable) in the openCyto package?
Mike may be able to answer this a bit better as he wrote the code, but adding a method to the generic provided by data.table seems like a reasonable approach, rather than having another method name to remember/pollute the namespace. What's the use case? Do you need to be able to call it without data.table
being attached? It's not ideal, but you could always explicitly call the method with
openCyto:::as.data.table.gatingTemplate(gt)
.
I am just using it to manipulate gatingTemplate entries. :::
generates R CMD CHECK NOTEs and importing into my package means I have to import a lot of other internal openCyto functions. It would be much simpler if it was a standalone function - but importing as.data.table
from data.table
will do the trick for now. At the moment I don't see a case where data.table
and openCyto
will not be loaded together but something for me to keep in mind going forward.
Hi @mikejiang & @jacobpwagner,
Would it be possible to to export
as.data.table.gatingTemplate
?I can see it in the
NAMESPACE
as an exportedS3 method
.This becomes apparent when you try to use this function:
Thanks, Dillon