Closed maelle closed 2 years ago
Oh, that's just because you need to load the package for the print method to work
oooooh. Should there be a warning? Or even an error right at the beginning? (not urgent)
Thanks @maelle and @assignUser, that was something I'd been wanting to solve for a while now, but really low-level. Solution is in that commit. This is how to list functions from a package regardless of whether the namespace is attached or not:
ls ("package:pkgcheck", envir = loadNamespace ("pkgcheck"))
Using a separate loadNamespace
command does not work, but passing loadNamespace
as the envir
arg to ls()
does. FYI.
Thank you, and nice trick!!
It reminds me of https://github.com/r-lib/usethis/issues/1579 solved in https://github.com/r-lib/usethis/pull/1597
Yeah, except even tricker. The previous version was effectively the solution in your second link above, of tryCatch-ing to list a package environment, but this one goes one (tiny) step further through that envir
parameter of ls
.
Running pkgcheck on