Should this package set `options(conflicts.policy = list(warn = FALSE))` when attaching?
We implement a stricter conflict resolution system here. Would be useful for reprexes and vignettes.
When attaching, you mean? Sounds reasonable to me, although I'd appreciate a link to the relevant docs.
See the "Conflicts" section in https://rdrr.io/r/base/library.html :
Conflicts
Handling of conflicts depends on the setting of the
conflicts.policy option. If this option is not set, then
conflicts result in warning messages if the argument
warn.conflicts is TRUE. If the option is set to the
character string "strict", then all unresolved conflicts signal
errors. Conflicts can be resolved using the mask.ok,
exclude, and include.only arguments to library and
require. Defaults for mask.ok and exclude can be
specified using conflictRules.
If the conflicts.policy option is set to the string
"depends.ok" then conflicts resulting from attaching declared
dependencies will not produce errors, but other conflicts will.
This is likely to be the best setting for most users wanting some
additional protection against unexpected conflicts.
The policy can be tuned further by specifying the
conflicts.policy option as a named list with the following
fields:
error:logical; if
TRUEtreat unresolved conflicts as errors.warn:logical; unless
FALSEissue a warning message when conflicts are found.generics.ok:logical; if
TRUEignore conflicts created by defining S4 generics for functions on the search path.depends.ok:logical; if
TRUEdo not treat conflicts with required packages as errors.can.mask:character vector of names of packages that are allowed to be masked. These would typically be base packages attached by default.
Seems like setting this option amounts to adding warn.conflicts = FALSE to each library() call.
We already have to shim library() so I'm not sure what this would get us.
I want the following to be silent. How to achieve?
library(conflicted)
library(duckplyr)
#> Loading required package: dplyr
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
#> ✔ Overwriting dplyr methods with duckplyr methods.
#> ℹ Turn off with `duckplyr::methods_restore()`.
Created on 2025-02-24 with reprex v2.1.1
Ooooh it's because it's not library() generating the errors directly, it's because duckdplyr requires dplyr.
I retract my objection 😄