Replies: 2 comments
-
The problem is that the shims for To reproduce it, if I create a new package with this function: fun <- function() {
library(conflicted)
print(environment(library))
} and then I run it and look at the output: pkgload::load_all()
fun()
#> <environment: namespace:base> Whereas outside the package I see this: library(conflicted)
environment(library) Loading Please see #849 for more discussion of |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for the quick reply.
I still don't understand why the order used to load the packages matters only inside targets, but that's not super important.
Thanks, I totally missed that discussion. The .Rprofile approach also solves my problem. Unfortunately, the only downside is that I need to explore manually what happens when I add a new package to |
Beta Was this translation helpful? Give feedback.
-
Help
Description
Dear package developers, a few minutes ago I was running some code in a (private) project that uses the packages
conflicted
andtargets
(and several more packages) and I noticed a weird interaction between the two of them. The following (quite long, sorry...) code exhibits the problem.If I run the problematic code without
targets
, I get an expected error which is raised byconflicted
:Created on 2023-02-24 with reprex v2.0.2
The same error occurs when
conflicted
is the last package I load. On other hand, when I run the previous code in atargets
workflow, it looks like theconflicted
package is ignored and I get another type of error (due to the fact that R runsscales::rescale
instead ofspatstat.geom::rescale
):Created on 2023-02-24 with reprex v2.0.2
The same does not occur when
conflicted
is the last loaded package:Created on 2023-02-24 with reprex v2.0.2
Session info
I'm not sure if this is expected behaviour but I would say that, at least for me, this is quite surprising. I also opened an equivalent issue in the github repo of the conflicted package: r-lib/conflicted#88. The same error persists with the github version of the two packages.
Beta Was this translation helpful? Give feedback.
All reactions