u/dagrim1

▲ 6 r/rstats

R shiny - version conflict with package in system library on shiny server

We have a shiny server where we can deploy our shiny apps, this has a system/default library path (/usr/lib64/R/library) which is only writable for the admins, not me.

I use my own library paths for the apps I make, setting them using .libPaths()

However, when accessing the shiny app through the browser it needs (and loads) the shiny package residing in the system path before getting to my .libPaths() method. This on it's turn loads rlang but the rlang version is too old for one of my packages.

So once my packages start loading (using the path I set using .libPAths()) I get an error:

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

Execution halted

I have tried reloading and also detaching (unloading) the old package, but this gives other issue due to the package being used by shiny (and others)

Error in detach(c("ellipsis", "lifecycle", "htmltools", "shiny"), unload = T) :
  invalid 'name' argument

Calls: <Anonymous> ... sourceUTF8 -> eval -> eval -> ..stacktraceon.. -> detach

Execution halted

Is there something I can do about this? Or does the admin really need to update the system wide packages.

Reason for using a library folder per shiny app is to prevent conflicts so I would really like to be able to somehow force it that way instead of needing to install/update system wide packages.

If I manually launch it from the terminal giving the .libPaths() command as an extra argument it seems to launch fine (can't access it through the browser though) but I can't do this when accessing it through the browser:

R -e ".libPaths('/srv/shiny-server/library/myapp/'); shiny::runApp('myapp')"

Any ideas?

reddit.com
u/dagrim1 — 12 days ago

BiocManager 3.22: Can't access index repository? (Unable to install packages, native ARM)

Because I have a surface laptop with ARM (snapdragon) cpu I recently switched from emulated x86 (Rstudio and R) to native arm (Positron and R). I have R version 4.5.3 which has BioConductor 3.22.

However, since yesterday I suddenly get the following error when trying to isntall something using BiocManager::install()

> BiocManager::install("BiocParallel")
Warning: unable to access index for repository https://bioconductor.org/packages/3.22/bioc/src/contrib:
  cannot open URL 'https://bioconductor.org/packages/3.22/bioc/src/contrib/PACKAGES'

This is with all packages. Trying to access the url directly results in a timeout, while changing 3.22 to 3.23 (newest Bioconductor version) I do get the package listing.

I tried installing R-4.6 and using BioConductor 3.23 (as BioConductor v3.23 only works on R v4.6) but this leads to another issue.

Warning: unable to access index for repository https://bioconductor.org/packages/3.23/bioc/bin/windows/clang-aarch64/contrib/4.6:

cannot open URL 'https://bioconductor.org/packages/3.23/bioc/bin/windows/clang-aarch64/contrib/4.6/PACKAGES'

With R v4.5.3 I was able to install packages even though they had to be compiled... But now it doesn't work at all anymore. install.packages() still works fine, it's just BiocManager causing issues.

It's both in Positron as command prompt btw.

Anyone any clue what's going on?

Btw, I also tried it with x86/x64 but same issue... Will check at work this afternoon if it's a network thing (which makes no sense at all)

reddit.com
u/dagrim1 — 20 days ago