I'm building an R package (mypackage) that imports data.table and another package (let's call it myotherpackage).
Imports: data.table, myotherpackage
is in the DESCRIPTION file of mypackage.
myotherpackage imports dplyr, which has several functions named like the data.table functions, so I get warnings like this everytime I load mypackage:
Warning: replacing previous import ‘data.table::first’ by ‘dplyr::first’ when loading ‘mypackage’
Is there a way to import all the functions of data.table except "first" for example? I'd then use data.table::first in the code if I need to use it. Or is there a better way to handle it? I'm trying to avoid the warning every time someones imports the package. Thank you!
importFrom(my other package, function)
directives in your NAMESPACE rather than importing all functions from the package. – Thomasimport(data.table, except=c(foo))
. See cran.r-project.org/doc/manuals/r-devel/…. I don't know if you can get that using roxygen markup, though. – Thomas#' @import data.table
):#' @rawNamespace import(data.table, except = first)
Do you wanna answer the question so I can give you credit? – Julien Massardier