antoine-sac antoine-sac - 1 month ago 8
R Question

Are explicit roxygen import from base package needed?

Concrete example:

In my package, one of my functions uses

form the

Should I explicitly import
or would that just introduce useless dependencies? I mean, everyone already has the
package, right?

For the sake of illustration:

#' Group_by with regex based column selection
#' Similar to `group_by` but grouping columns are selected with a regex.
#' @importFrom dplyr group_by
#' @importFrom base grep
#' @export
group_at <- function(df, pattern)
group_by_(df, .dots=grep(names(df), pattern=pattern, value=T))


From the Writing R Extensions manual sec.1.1.3:

It makes no sense to declare a dependence on R without a version specification, nor on the package base: this is an R package and package base is always available.