macOS High Sierra环境下安装R包phia报错求助
Hey there, let's work through this phia package installation problem you're hitting with RStudio 1.1.383 on macOS High Sierra 10.13.3. Here are targeted steps to resolve the dependency conflicts and URL access issues:
First, manually install the source versions of the outdated dependencies
The error notes thatrioandcarhave newer source versions available (and they don't require compilation, which simplifies things). Install these source versions first to avoid version mismatches:# Install latest source version of rio install.packages("rio", type = "source", repos = "http://cran.r-project.org") # Install latest source version of car install.packages("car", type = "source", repos = "http://cran.r-project.org")Install the phia package next
Once the dependencies are up to date, run your original installation command again:install.packages("phia", repos = "http://cran.r-project.org", dependencies = TRUE)Troubleshoot URL access failures
If you still get errors accessing the CRAN URL, switch to a more stable domestic mirror—just replace the repos parameter with this address:install.packages("phia", repos = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/", dependencies = TRUE)Check your R version (critical for car compatibility)
A common gotcha here:carversion 3.0-0 requires R 3.5.0 or newer. If you're running an older R version (likely the case with RStudio 1.1.383 on High Sierra), you'll need to upgrade R to a version compatible with macOS 10.13. The last R version supporting High Sierra is 4.1.3—install this, restart RStudio, and repeat the steps above.
This issue pops up because older macOS releases like High Sierra no longer get updated binary packages from CRAN, forcing us to use source versions. Pair that with strict R version requirements for newer package releases, and upgrading R (if needed) becomes key.
内容的提问来源于stack exchange,提问作者ferris09

