R isn't installing packages

Hello,

I can't seem to install packages in R. I'm using the code install.packages(''packagename"). I started having this issue when I was trying to install "onewaytests" and found that I needed the package "car" to do so. However, I can't seem to download "car" by itself or in "devtools". When I run install.packages("devtools") it gives me a zero exit status for every package it tries to install and removes it. I've tried updating R several times now. I'm working on a mac. Please help! I would really like to analyze my data and it's frustrating that I can't even get started.

Thanks

Oh sorry, I'm using R studio. Version 1.4.1717

Package installation issues are very specific and you are only providing an overview of your issue. Choose an specific package that you want to install, then post the complete error message you get and we can go frome there

install.packages("onewaytests")

also installing the dependencies ‘mime’, ‘clipr’, ‘BH’, ‘backports’, ‘generics’, ‘purrr’, ‘stringr’, ‘tidyr’, ‘tidyselect’, ‘evaluate’, ‘highr’, ‘markdown’, ‘yaml’, ‘xfun’, ‘matrixStats’, ‘RcppArmadillo’, ‘forcats’, ‘readr’, ‘cpp11’, ‘zip’, ‘stringi’, ‘colorspace’, ‘broom’, ‘dplyr’, ‘numDeriv’, ‘knitr’, ‘SparseM’, ‘MatrixModels’, ‘conquer’, ‘sp’, ‘haven’, ‘curl’, ‘data.table’, ‘openxlsx’, ‘minqa’, ‘nloptr’, ‘RcppEigen’, ‘farver’, ‘labeling’, ‘munsell’, ‘RColorBrewer’, ‘viridisLite’, ‘carData’, ‘abind’, ‘pbkrtest’, ‘quantreg’, ‘maptools’, ‘rio’, ‘lme4’, ‘digest’, ‘gtable’, ‘isoband’, ‘scales’, ‘withr’, ‘moments’, ‘car’, ‘ggplot2’, ‘nortest’

There are binary versions available but the source versions are later:
binary source needs_compilation
cpp11 0.2.7 0.3.1 FALSE
colorspace 2.0-1 2.0-2 TRUE
broom 0.7.7 0.7.8 FALSE
ggplot2 3.3.4 3.3.5 FALSE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) y

#it successfully installed a bunch of stuff and then...#

  • installing source package ‘cpp11’ ...
    ** package ‘cpp11’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
  • DONE (cpp11)
  • installing source package ‘colorspace’ ...
    ** package ‘colorspace’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ERROR: compilation failed for package ‘colorspace’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/colorspace’
    Warning in install.packages :
    installation of package ‘colorspace’ had non-zero exit status
  • installing source package ‘broom’ ...
    ** package ‘broom’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    *** copying figures
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
  • DONE (broom)
  • installing source package ‘ggplot2’ ...
    ** package ‘ggplot2’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    there is no package called ‘colorspace’
    Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
    Execution halted
    ERROR: lazy loading failed for package ‘ggplot2’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/ggplot2’
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/kv/p657h67x0kj_ym795wgg6qgc0000gn/T/RtmpZcRpgG/downloaded_packages’

library("onewaytests")
Error: package or namespace load failed for ‘onewaytests’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘ggplot2’

#I took out the URLs#

For compiling packages from source in macOS, you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

Okay, I downloaded Xcode. I don't think I can use the fortran download from the website you sent because it is for High Sierra and my laptop is now Big Sur. I followed a link to a github website with mac gfortran fxcoudert releases? I tried downloading two of these that specify they are for Big Sur, but neither can be downloaded- I get a notice that says that my computer can't check it for malware and the software needs to be updated. Any idea where to go from here?

Also, can you explain why I need to compile source code to get onewaytests running? It seems like a pretty typical thing to need to run a brown-forsythe test for data analysis, so I don't understand why the packages necessary to run bf.test (onewaytests and dependent car) don't have binary code for mac?? Why can't I just use install.packages? Do you know?

Thanks for your help

Sorry, I can't help you with macOS specifics because I'm not a macOS user.

Because some of the package dependencies have newer versions and they do not have binaries available yet, it takes some time to compile binaries for all the package updates but there will be binaries in a few days.

Oh okay. Is there somewhere that people can check when binary code will be done by for specific packages?

Not that I'm aware of, as far as I know, package compiling for a specific OS is done by a single person from the R core team and that person volunteers their time so is not like they have strict deadlines.

The best you can do is to check the CRAN page for the package and see if there are binaries available for your OS, for example, ggplot2 binaries are already available.

macOS binaries: r-release (arm64): ggplot2_3.3.5.tgz, r-release (x86_64): ggplot2_3.3.5.tgz, r-oldrel: ggplot2_3.3.5.tgz

Okay great. Thank you!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.