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
Initial motivation: eddelbuettel/r2u#30. It would be nice to have a mechanism to detect and report shadowed packages, i.e. packages that are available in several .libPaths(). In this first iteration, I devise:
An exported function, e.g. bspm::shadowed_packages(), which would work as a thin wrapper around installed.packages(). It would filter its output to detect package shadowing and would return a matrix (to follow the same convention) with at least the following columns: Package, LibPath, Version, ShadowPackage, ShadowLibPath, and ShadowVersion or similar naming. Basically, the idea is that each row is a Package that is being shadowed by ShadowPackage in a ShadowLibPath with higher priority.
A non-exported function that takes the output from (1) and generates one message (warning?) per row to alert the user about shadowed packages.
Integration of the alert messages (with shut-off switches via options). Possible places that come to mind:
On bspm startup.
On package installation, a message/warning for packages that have another one shadowing them. This would be available only for the default slower-but-safer mode, not in the binary-source mode.
No comment with code yet, been meaning to write one for my own use (as I believe I mentioned to your prior to eddelbuettel/r2u#30) and would (at least locally) default to sort via data.table. If and when I have something I may drop here.
The need is actually broader than bspm as you and I discussed. It can arise whenever length(.libPaths()) > 1.
Initial motivation: eddelbuettel/r2u#30. It would be nice to have a mechanism to detect and report shadowed packages, i.e. packages that are available in several
.libPaths()
. In this first iteration, I devise:bspm::shadowed_packages()
, which would work as a thin wrapper aroundinstalled.packages()
. It would filter its output to detect package shadowing and would return a matrix (to follow the same convention) with at least the following columns:Package
,LibPath
,Version
,ShadowPackage
,ShadowLibPath
, andShadowVersion
or similar naming. Basically, the idea is that each row is aPackage
that is being shadowed byShadowPackage
in aShadowLibPath
with higher priority.bspm
startup.binary-source
mode.@eddelbuettel As always, comments welcome.
The text was updated successfully, but these errors were encountered: