fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

alright, I'm sure I'm missing something obvious here, but:

how can I get a callr session to not "see" libraries that are installed on a computer? See below; even setting libpath to /dev/null doesn't "hide" my system sf from r()

@tanho this makes me think I'm misunderstanding something deeper about what's a valid thing to set libpaths to:

> withr::with_libpaths("/dev/null", .libPaths())
[1] "/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library"

Gabor Csardi

@MikeMahoney218 @tanho It is not possible "turn off" the system library. So if you install your own non-core packages there, you can't turn those off, either. One reason why it is better to always create a user library and install packages there.

@tanho @gaborcsardi trying to write a blog showing how methods are only found if the relevant package is loaded -- and how patchwork, sf now use a trick to load their package when their objects are deserialized. So was hoping to be able to run code that couldn't find those libraries, in the same qmd as (& after) code that uses them

@MikeMahoney218 @gaborcsardi bleck, in that case I might be trying to stub out requireNamespace with mockery or smth, which is definitely not the most elegant way

@tanho @gaborcsardi sounds like I'm overdue for using a user library anyway, so might just reinstall everything to a new user library and then callr will only see the base libraries. With a footnote and a link to this thread in the eventual post 😂

@gaborcsardi @MikeMahoney218 @tanho FWIW, I'm in the camp who thinks R should, by design, make the system package library read-only when R installed and never allow any packages other than the core base-R packages from being installed there. Not even recommended packages. It should never ever change after R has been installed. Without that, an R installation may differ from computer to computer even when being of the same R version.

@kupac @gaborcsardi @MikeMahoney218 @tanho

Hehe. So, unless things changed since June 2022, this is a real problem for all macOS R users, because their the system package library folder is writable by default.

I think that's a really bad idea, but not everyone agrees, cf.
stat.ethz.ch/pipermail/r-sig-m

stat.ethz.ch [R-SIG-Mac] CRAN installer for macOS - directory permissions