Namespace torture

Help, I'm being tortured by R. Just now I tried to load a package called RedTor. It generates

Error: package or namespace load failed for ‘RedTor’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.9 is required

This isn't just related to RedTor (a custom package). It's more pervasive and seems to be a namespace problem. If I can use the unloadNamespace() function, I can get things working.

I first try

unloadNamespace("rlang")
and get
Error in unloadNamespace("rlang") :
namespace ‘rlang’ is imported by ‘ellipsis’, ‘testthat’, ‘pkgload’, ‘pillar’, ‘lifecycle’, ‘htmltools’, ‘usethis’ so cannot > be unloaded

So I need to unload those, but those may in turn generate other messages.

It seems that this is related to what gets loaded in R. I run sessionInfo() and note what is loaded via a namespace (and not attached) - about 41 packages. Wish I knew how to keep these from loading. Any help appreciated. I have no .rdata being loaded as far as I can tell and no packages loading in .renviron.

You should install a sufficiently high version of the rlang package, for the packages you depend on to work.
R's message to you seems explicit enough to me... you have 0.4.7 but 0.4.9 or higher is what you need

That was my first thought and I appreciate the reply. I actually have version 4.10 installed. It seems to me other packages are loading loading the earlier version (how I don't understand). That's why I'm trying to unload so many namespaces so I can first load packages with newer versions. To be clear, in my packages list I can see that I have version 4.1 of rlang.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.