Scans for namespace conflicts among attached packages and interactively helps the user resolve them. The function adapts its recommendations based on whether it detects a package development environment or a standalone analysis script.
Value
Invisibly returns a named list with components: status ("done" or
"clean"), conflicts (named list), resolutions (named list),
and context ("package" or "standalone").
Details
The function performs the following steps:
Identifies all functions that are masked by multiple attached packages.
Interactively prompts the user to select the preferred package for each conflicting function.
If a
DESCRIPTIONfile is present (Package Development context), it suggests updating theImportsfield and adding@importFromroxygen2 tags.If no
DESCRIPTIONfile is present (Standalone context), it generates a code snippet to explicitly assign the preferred functions and offers to apply them.
Warning
This function modifies files on disk or the global environment. Please ensure you have a backup or are using version control (e.g., Git) before execution.
Examples
if (interactive()) {
detect_masking()
}
