StatsBomb- Installation Advice Needed

Hi - I was so excited to discover StatsBomb and try out a project with there free data, but I cannot get "SDMtools" or "StatsBombR" to install. I get a warning message about a non-zero exit status.

I would greatly appreciate any help. I have read some older posts, and it looks like maybe the package is not updated for the latest version of R?

install.packages("tidyverse")
install.packages("devtools")
install.packages("ggplot2")
install.packages("devtools")
devtools::install_github("statsbomb/SDMTools")
devtools::install_github("statsbomb/StatsBombR")

Warning message:
In i.p(...) :
installation of package β€˜C:/Users/ANNCHI~1/AppData/Local/Temp/RtmpGAdO8c/file247842022119/SDMTools_1.1-222.tar.gz’ had non-zero exit status

devtools::install_github("statsbomb/StatsBombR")

Can you include the complete output of

devtools::install_github("statsbomb/SDMTools")

? Thanks!

I hope this helps. I have included the console output for devtools::install_github("statsbomb/SDMTools
and
devtools::install_github("statsbomb/StatsBombR")
Thanks so much for all advice!

 devtools::install_github("statsbomb/SDMTools")
Downloading GitHub repo statsbomb/SDMTools@HEAD
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────
βœ”  checking for file 'C:\Users\Ann Chisnell\AppData\Local\Temp\Rtmpqg1guG\remotes83a8100c549a\statsbomb-SDMTools-5d22d7a/DESCRIPTION' ...
─  preparing 'SDMTools': (548ms)
βœ”  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building 'SDMTools_1.1-222.tar.gz'
   
Installing package into β€˜C:/Users/Ann Chisnell/AppData/Local/R/win-library/4.3’
(as β€˜lib’ is unspecified)
* installing *source* package 'SDMTools' ...
** using staged installation
** libs
gcc  -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG     -I"c:/rtools43/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c ConnectedComponentLabelling.c -o ConnectedComponentLabelling.o
/bin/sh: line 1: gcc: command not found
make: *** [C:/PROGRA~1/R/R-43~1.0/etc/x64/Makeconf:265: ConnectedComponentLabelling.o] Error 127
ERROR: compilation failed for package 'SDMTools'
* removing 'C:/Users/Ann Chisnell/AppData/Local/R/win-library/4.3/SDMTools'
Warning message:
In i.p(...) :
  installation of package β€˜C:/Users/ANNCHI~1/AppData/Local/Temp/Rtmpqg1guG/file83a868a01b2b/SDMTools_1.1-222.tar.gz’ had non-zero exit status
> devtools::install_github("statsbomb/StatsBombR")
Downloading GitHub repo statsbomb/StatsBombR@HEAD
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────
βœ”  checking for file 'C:\Users\Ann Chisnell\AppData\Local\Temp\Rtmpqg1guG\remotes83a827896f44\statsbomb-StatsBombR-b0a5ee7/DESCRIPTION' ... 
─  preparing 'StatsBombR': (622ms)
βœ”  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/Ann Chisnell/AppData/Local/R/win-library/4.3’
(as β€˜lib’ is unspecified)
* installing *source* package 'StatsBombR' ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Warning: replacing previous import 'jsonlite::flatten' by 'purrr::flatten' when loading 'StatsBombR'
Warning: replacing previous import 'foreach::when' by 'purrr::when' 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: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package 'StatsBombR'
* removing 'C:/Users/Ann Chisnell/AppData/Local/R/win-library/4.3/StatsBombR'
Warning message:
In i.p(...) :
  installation of package β€˜C:/Users/ANNCHI~1/AppData/Local/Temp/Rtmpqg1guG/file83a8ece6811/StatsBombR_0.1.0.tar.gz’ had non-zero exit status

If you want to build R packages with compiled code from source, then you need to install the necessary compilers, on windows this means Rtools: RTools: Toolchains for building R and R packages from source on Windows

Thank you for the explanation. I am confused with the installation of Rtools. I have RStudio 4.3.0, so I tried to install Rtools43. I installed onto my computer in Windows at C:\rtools43 . In RStudio, I ran
Sys.which("make")
with Console Output

 make 
"C:\\rtools43\\usr\\bin\\make.exe"

Could you please explain what I am doing wrong or what I need to do next?

You are not doing anything wrong. If you installed Rtools43, then you should be able to install these packages. It seems like SDMTools is not installed properly, so try to (re)install that first.

Ok, Yeah! SDM Tools is installed. Now, I am stuck with the following Console Output for StatsBombR installation.
script:
devtools::install_github("statsbomb/StatsBombR")
Console Output

> devtools::install_github("statsbomb/StatsBombR")
Downloading GitHub repo statsbomb/StatsBombR@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                          
2: CRAN packages only           
3: None                         
4: vctrs (0.6.2 -> 0.6.3) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1
vctrs (0.6.2 -> 0.6.3) [CRAN]
Installing 1 packages: vctrs
Installing package into β€˜C:/Users/Ann Chisnell/AppData/Local/R/win-library/4.3’
(as β€˜lib’ is unspecified)

  There is a binary version available but the source version is later:
      binary source needs_compilation
vctrs  0.6.2  0.6.3              TRUE

Thank you so much for your patience with me. I am getting closer!

Yes, that's the output. But what is under this output? If you have a question there, then answer that question. If there is no question, then there is an installation attempt I suppose.

I am not seeing StatsBombR show up in my Packages in the Output Pane. I just tried to rerun my script and was given this in the Console:
devtools::install_github("statsbomb/StatsBombR")
Downloading GitHub repo statsbomb/StatsBombR@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: vctrs (0.6.2 -> 0.6.3) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1
vctrs (0.6.2 -> 0.6.3) [CRAN]
Installing 1 packages: vctrs
Installing package into β€˜C:/Users/Ann Chisnell/AppData/Local/R/win-library/4.3’
(as β€˜lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/vctrs_0.6.3.zip'
Content type 'application/zip' length 1329055 bytes (1.3 MB)
downloaded 1.3 MB

package β€˜vctrs’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package β€˜vctrs’
Warning: restored β€˜vctrs’

The downloaded binary packages are in
C:\Users\Ann Chisnell\AppData\Local\Temp\RtmpaApZ5m\downloaded_packages
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────
:heavy_check_mark: checking for file 'C:\Users\Ann Chisnell\AppData\Local\Temp\RtmpaApZ5m\remotes3380380e4933\statsbomb-StatsBombR-b0a5ee7/DESCRIPTION' (343ms)
─ preparing 'StatsBombR': (691ms)
:heavy_check_mark: 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/Ann Chisnell/AppData/Local/R/win-library/4.3’
(as β€˜lib’ is unspecified)

  • installing source package 'StatsBombR' ...
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    Warning: replacing previous import 'jsonlite::flatten' by 'purrr::flatten' when loading 'StatsBombR'
    Warning: replacing previous import 'foreach::when' by 'purrr::when' when loading 'StatsBombR'
    Warning: replacing previous import 'foreach::accumulate' by 'purrr::accumulate' when loading
'StatsBombR'
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Warning: replacing previous import 'jsonlite::flatten' by 'purrr::flatten' when loading 'StatsBombR'
Warning: replacing previous import 'foreach::when' by 'purrr::when' when loading 'StatsBombR'
Warning: replacing previous import 'foreach::accumulate' by 'purrr::accumulate' when loading 'StatsBombR'
** testing if installed package can be loaded from final location
Warning: replacing previous import 'jsonlite::flatten' by 'purrr::flatten' when loading 'StatsBombR'
Warning: replacing previous import 'foreach::when' by 'purrr::when' when loading 'StatsBombR'
Warning: replacing previous import 'foreach::accumulate' by 'purrr::accumulate' when loading 'StatsBombR'
** testing if installed package keeps a record of temporary installation path
* DONE (StatsBombR)
Warning message:
In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying C:\Users\Ann Chisnell\AppData\Local\R\win-library\4.3\00LOCK\vctrs\libs\x64\vctrs.dll to C:\Users\Ann Chisnell\AppData\Local\R\win-library\4.3\vctrs\libs\x64\vctrs.dll: Permission denied

This means that it was installed.

Maybe restart the R session?

Yeah! It is there! Thank so much for sticking with me. I know others have been stuck on this, so I'll be sure to share.

1 Like

This topic was automatically closed 7 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.