3

edit: all screenshots are displayed

I'm teaching stats in Rstudio and we're using the summarytools package. A few of my students are getting different error messages, with the same overall result that the package is not properly installed.

Alex's error seems to download, but not sure if it is installing and the library function cannot find the summarytools package.

Screenshot of Alex's error message

Aroun's error is happening mid-install, something about failing to install or load a supporting package 'stringr'.

Screenshot of Aroun's error message

Zoey's error says something about a non-zero exit status.

Screenshot of Zoey's error message

While I can run stats in R, I'm a complete newb at troubleshooting package errors. Since I'm not directly experiencing these errors, it is double-difficult to troubleshoot. Any help is appreciated.

Best, Shawn

Dominic Comtois
  • 10,230
  • 1
  • 39
  • 61
Shawn Janzen
  • 369
  • 3
  • 15
  • For me, I was unable to install the package dependency 'magick'. On Centos I did `yum install ImageMagick-c++-devel` to get the required platform specific libraries, then reran the R package install – Phil Nov 29 '22 at 14:57

3 Answers3

1

It is difficult to judge from these errors, what actually happens. Still, my conjecture is broken or incomplete R installations.

When using R on Windows, please double-check that you installed 1) a single version of R 2) Rtools giving compilers to R Without Rtools, R will only function in a very limited sense as it cannot compile packages and depends on binary packages that might have been compiled with different versions of R on different platforms.

If these two ideas don't solve the problem and as you are teaching, please think about using a single VM or Docker image (my approach in teaching) such that you and all your students have exactly the same software platform. With this approach, you can use a stable Linux, where R is integrated and well-tested.

user3640029
  • 165
  • 4
  • Appreciated. I'll check back with the students about a reinstall of R. I believe all of them are running Windows, although some of my students are using Mac. I'm not familiar with running R from a central VM, but it is an interesting suggestion. However, while that sounds like a great way to have everyone accessing the same machine capabilities, it does not sound like it would do well for offline access. – Shawn Janzen Apr 02 '18 at 18:35
1

Overview

I think - because without each of your student's sessionInfo() output I am only able to make recommendations based off their error messages - the following will help:

  • Alex: install.packages( pkgs = c("digest", "rapportools") ).
  • Zoey & Aroun: install.packages( pkgs = "stringr" ).
  • Afterwards, have all three run install.packages( pkgs = "summarytools" ).
  • If all else fails, you can have all three run the following commands to install the package from GitHub: install.packages("devtools") followed by devtools::install_github("dcomtois/summarytools").

Methodology

I installed summarytools with the following command install.packages( pkgs = "summarytools" ). All of your students did the same, which led me to print out my session information using sessionInfo():

R version 3.4.3 (2017-11-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] summarytools_0.8.2

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.16       matrixStats_0.53.1 codetools_0.2-15   digest_0.6.14      bitops_1.0-6      
 [6] plyr_1.8.4         magrittr_1.5       stringi_1.1.7      pryr_0.1.4         rapportools_1.0   
[11] tools_3.4.3        stringr_1.3.0      pander_0.6.1       RCurl_1.95-4.10    rsconnect_0.8.8   
[16] compiler_3.4.3     htmltools_0.3.6   

Based on the error messages from each of your students, the installation of summarytools seems to be failing due to dependency packages (i.e. rapportools, digest, and stringr) not downloading with their download of summarytools.

Cristian E. Nuno
  • 2,822
  • 2
  • 19
  • 33
0

This is an updated answer

For Alex's problem, I suspect the apostrophe in the path ("Alex's PC") might be the culprit.

For Zoey's and Aroun's, it's not clear, maybe some permission issues...?

Possible solutions (for all three cases)

1 - Preferably, try installing through Github:

install.packages('devtools') # if not already installed
library(devtools)
install_github("dcomtois/summarytools")

2 - If solution 1 fails or is not possible for whatever reason, install the latest binaries instead of the most recent (source) version.

install.packages('summarytools', type = 'binary')

3- If all that fails, I'd suggest trying this prior to installation as a last resort. Normally this shouldn't be necessary, but it can't hurt. After completion, try regular install or one of the two previous solutions.

install.packages(c('htmltools', 'matrixStats', 'pander', 'pryr', 
                   'rapportools', 'RCurl', 'Hmisc', 'rstudioapi', 
                   'rmarkdown', 'stringr'))
install.packages('knitr', dependencies = TRUE)
update.packages(ask = FALSE, repos = 'https://cran.rstudio.org')
Dominic Comtois
  • 10,230
  • 1
  • 39
  • 61