Starting with library(tidyverse) is fine for data analysis, but in package development it's better to keep your dependencies lighter and more specific. Including tidyverse in your imports in the DESCRIPTION results in installing many packages not used by your package. Make this specific to what you actually need. You have several options for how to use functions that you need from these packages:
add them to "Depends" - this results in the package loading when your package is loading, which can slow down package loading and result in a cluttered NAMESPACE. It should only be used if you need numerous functions from the package, so you don't want to have to specify them all. It can also result in unintended collisions if people load other packages providing functions of the same name and you don't use :: as below.
add them to "Imports", and
a. use importFrom directives that go from roxygen2 into your NAMESPACE to specify which functions you use from that package, or
b. use :: within the code every time (e.g. rvest::read_html) - the most expressive but can become tedious if you have to do it a lot.
Starting with
library(tidyverse)
is fine for data analysis, but in package development it's better to keep your dependencies lighter and more specific. Includingtidyverse
in your imports in the DESCRIPTION results in installing many packages not used by your package. Make this specific to what you actually need. You have several options for how to use functions that you need from these packages:::
as below.importFrom
directives that go from roxygen2 into your NAMESPACE to specify which functions you use from that package, or b. use::
within the code every time (e.g.rvest::read_html
) - the most expressive but can become tedious if you have to do it a lot.