You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not just a warning*, this prevents compilation (at least on R 4.1.3).
This happens too often in cases where I'm dumping all the imports into the top of a file (a la#include statements) and neglect to terminate the block with a NULL, e.g.
# in R/foo.R#' @importFrom dplyr group_by# <- should be a NULL here to terminate the block, but forgot it#' Here is a function#' @exportfoo<-identity
roxygenize() makes this NAMESPACE:
# Generated by roxygen2: do not edit by hand
export(foo)
importFrom(dplyr,"function")
importFrom(dplyr,Here)
importFrom(dplyr,a)
importFrom(dplyr,group_by)
importFrom(dplyr,is)
And compilation fails:
R CMD INSTALL .* installing to library ‘...’
* installing *source* package ‘tmpPkg’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Error: object ‘function’ is not exported by 'namespace:dplyr'
Execution halted
ERROR: lazy loading failed for package ‘tmpPkg’
+💯 to difficulty dealing with this error without a trained eye.
* Oh, I see, roxygenize() throws a warning. But we don't always see the warning if other processes are calling roxygenize() or it gets buried.
Ie. for an
@importFrom pkg fun
we could check iffun
is an exported function ofpkg
.Otherwise R will throw a warning when the package is loaded, and it is sometimes hard to deduct where the warning is coming from.
The text was updated successfully, but these errors were encountered: