RStudio中安装broom与nlme包失败问题求助
Hey there, let's break down why you're hitting this error when trying to install broom. Looking at your error log and the library path /home/gherr/R/x86_64-pc-linux-gnu-library/3.2/, it's clear you're running R 3.2.x—a version that's over 8 years old at this point. Most modern CRAN packages (including newer versions of broom, psych, and nlme) no longer support such an outdated R release, which is the root cause here.
Here are two ways to fix this:
Option 1: Upgrade Your R Version (Highly Recommended)
This is the most straightforward and long-term solution. Newer R versions come with better compatibility, more features, and bug fixes:
- Head to the official R website to download the latest version for your Linux system, then follow the installation instructions for your distro.
- Once upgraded, restart RStudio and run
install.packages("broom")again. All dependencies should install automatically without issues.
Option 2: Install Older Package Versions (Only if You Can't Upgrade R)
If upgrading R isn't an option right now, you'll need to track down older versions of the packages that work with R 3.2.x:
- First, install an older
nlmeversion that supports R 3.2 (likenlme 3.1-122):- Download the
.tar.gzfile for this version from CRAN's archive. - Run this command in RStudio (replace the file path with where you saved the download):
install.packages("/path/to/nlme_3.1-122.tar.gz", repos = NULL, type = "source")
- Download the
- Next, install an older
psychversion (likepsych 1.5.8):- Grab the compatible
.tar.gzfrom CRAN's archive, then install with:install.packages("/path/to/psych_1.5.8.tar.gz", repos = NULL, type = "source")
- Grab the compatible
- Finally, install an older
broomversion (likebroom 0.4.1):- Download the matching
.tar.gzand run:install.packages("/path/to/broom_0.4.1.tar.gz", repos = NULL, type = "source")
- Download the matching
Just a heads-up: This method is clunky, and older package versions might have bugs or missing features. Upgrading R is definitely the better call if you can swing it.
内容的提问来源于stack exchange,提问作者rebeccah

