installation of package ... had non-zero exit status

Hello, I'm trying to learn R for a project, so I'm very new to this and therefore this might be an obvious question but here goes.

I'm following a guide on what to download to set up all the R tools I need here:

It is directing me to first download RStudio, which I've done, and then use it to download the following packages: tidyverse, devtools, ggplot2. Which downloaded fine to my knowledge.

When I tried to download "StatsBombR" it gave me an error message, I will post the whole linefeed here:

Downloading GitHub repo statsbomb/StatsBombR@HEAD
√ checking for file 'C:\Users\Jacob\AppData\Local\Temp\RtmpINyEgW\remotes5b24272e2809\statsbomb-StatsBombR-0aa173f/DESCRIPTION'

  • preparing 'StatsBombR': (542ms)
    √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
    Omitted 'LazyData' from DESCRIPTION
  • building 'StatsBombR_0.1.0.tar.gz'
    Installing package into ‘C:/Users/Jacob/Documents/R/win-library/4.1’
    (as ‘lib’ is unspecified)
  • installing source package 'StatsBombR' ...
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    Warning: replacing previous import 'foreach::when' by 'purrr::when' when loading 'StatsBombR'
    Warning: replacing previous import 'jsonlite::flatten' by 'purrr::flatten' when loading 'StatsBombR'
    Warning: replacing previous import 'foreach::accumulate' by 'purrr::accumulate' when loading 'StatsBombR'
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    there is no package called 'SDMTools'
    Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
    Execution halted
    ERROR: lazy loading failed for package 'StatsBombR'
  • removing 'C:/Users/Jacob/Documents/R/win-library/4.1/StatsBombR'
    Warning message:
    In i.p(...) :
    installation of package ‘C:/Users/Jacob/AppData/Local/Temp/RtmpINyEgW/file5b247c8b3ff0/StatsBombR_0.1.0.tar.gz’ had non-zero exit status

I'm not sure how to deal with this error message, I have googled it and I'm not getting anything actionable. Please let me know if I can provide any other information on how to successfully download this package.

Thank you in advance!

I guess you installed via remotes or devtools? That doesn't install missing dependencies by default. Looks like that is biting you - there is no package called 'SDMTools' is the clue. Either install it seperately (install.packages('SDMTools')) and try again or add dependencies = TRUE to your call to remotes::install_github (or devtools::install_github if thats what you're using instead).

Installing an older version of SDMTools worked for this! 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.