I'm running RStudio on MacOS Sonoma 14.7.1 on an M4 Macbook. I haven't updated either RStudio or the OS for several months.

However, I updated R to version 4.5.0 recently, and to 4.5.1 today. In both of those versions I'm seeing some strange behaviour when I ask RStudio to install a package that I'm developing. I haven't seen this before, and I haven't noticed it in other packages.

The behaviour I see is that the package is installed
and RStudio restarts the session and runs `library(pkg)`, but it loads the old version of the package.

I don't use the devtools option, so RStudio says it is running

  R CMD INSTALL --preclean --no-multiarch --with-keep.source pkg

If I manually restart the R session and run `library(pkg)` I get the new one, so it appears that RStudio is loading the package before it is fully installed.

Has anyone else seen this? I'd especially like to know if people have seen it outside of RStudio. I suspect it's a bug there, but as I said, I haven't updated it recently.

BTW, I think I know how to stop this in RStudio: In the "Global Options | Packages | Development" dialog, there's an option "Use alternate library path when building package".

If checked, this builds to


/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library/_build

instead of to

  /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library

then moves the package into place afterwards. I've only seen the strange behaviour when I have that option checked, which is what makes me think this is an RStudio bug --- but somehow triggered by something new in R 4.5.x.

Duncan Murdoch

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to