dcomtois / summarytools

R Package to Quickly and Neatly Summarize Data
523 stars 78 forks source link

Summarytools Hangs when using library #136

Open adam-s-elder opened 3 years ago

adam-s-elder commented 3 years ago

Currently when I try to library in summarytools the R session will hang forever:

> library(summarytools)
Registered S3 method overwritten by 'pryr':
  method      from
  print.bytes Rcpp

I have waited for about 30 minutes, but nothing happens. Similarly (in Rstudio) it appears that using :: fails as well:

> summarytools::nothing

Will also just hang (instead of producing an error). Both of these things happen even when I open up a new R session. I have never experienced an issue like this, and was wondering if anyone had any suggestions.

Here is my Rstudio and Session Info (I libraried in Rcpp in case that is useful):

RStudio: Version 1.4.1103 © 2009-2021 RStudio, PBC "Wax Begonia" (458706c3, 2021-01-06) for macOS Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS  10.16

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] Rcpp_1.0.6

loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2    yaml_2.2.1  

I have magik++ installed:

> brew install imagemagick@6
Warning: imagemagick@6 6.9.11-61 is already installed and up-to-date.
To reinstall 6.9.11-61, run:
   brew reinstall imagemagick@6

I also re-downloaded Xquartz and placed it in my applications folder, but this did not fix anything either.

Any help would be greatly appreciated. Thank you!

dcomtois commented 3 years ago

Is it the first time you install the package? If not, did you update something recently? Maybe try installing one of the branches from GitHub... Let us know if that works out! Thx

remotes::install_github("dcomtois/summarytools")
# or
remotes::install_github("dcomtois/summarytools", ref="dev-current")
adam-s-elder commented 3 years ago

I updated all of my packages recently (but also recently updated to Rstudio 1.4).

The first time I tried to download, it just hung while trying to build. After this I force quit the application and got the following error:

remotes::install_github("dcomtois/summarytools")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo dcomtois/summarytools@HEAD
✓  checking for file ‘/private/var/folders/c0/_98bzxtd0yn7x95q6vbqmfjm0000gn/T/Rtmp2gCqdO/remotes8c6b1ede3c2/dcomtois-summarytools-9b1f9b3/DESCRIPTION’ ...
─  preparing ‘summarytools’:
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘summarytools_0.9.8.tar.gz’

ERROR: failed to lock directory ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library’ for modifying
Try removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-summarytools’
Error: Failed to install 'summarytools' from GitHub:
  (converted from warning) installation of package ‘/var/folders/c0/_98bzxtd0yn7x95q6vbqmfjm0000gn/T//Rtmp2gCqdO/file8c6b2903d68b/summarytools_0.9.8.tar.gz’ had non-zero exit status

Even after removing the package itself and the 00LOCK-summarytoolss folder, I am still getting the above error (even when I use ref = "dev-current").

dcomtois commented 3 years ago

This is usually because there is a temporary directory that you must delete, as you can see from the message:

Try removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-summarytools

Manually deleting this is a first step!

adam-s-elder commented 3 years ago

Ah. Thanks for the info. I was using unlink in R, but I guess that doesn't do anything (also does not give a warning that it is not doing anything).

Ok. Running this again, here is where the hang happens now:

> remotes::install_github("dcomtois/summarytools", ref="dev-current")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo dcomtois/summarytools@dev-current
✓  checking for file ‘/private/var/folders/c0/_98bzxtd0yn7x95q6vbqmfjm0000gn/T/Rtmp2gCqdO/remotes8c6b63df5ea2/dcomtois-summarytools-74a1390/DESCRIPTION’ ...
─  preparing ‘summarytools’:
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘summarytools_0.9.9.tar.gz’

* installing *source* package ‘summarytools’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading

I was starting to think this may not be specific to summarytools, so I tried to download a different package from github, but this seems to work:

> remotes::install_github("bdwilliamson/vimp")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo bdwilliamson/vimp@HEAD
✓  checking for file ‘/private/var/folders/c0/_98bzxtd0yn7x95q6vbqmfjm0000gn/T/Rtmpl9YGpS/remotesb8a67a111ccf/bdwilliamson-vimp-7662357/DESCRIPTION’ ...
─  preparing ‘vimp’:
✓  checking DESCRIPTION meta-information ...
─  installing the package to process help pages
─  saving partial Rd database (2.7s)
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘vimp_2.1.6.tar.gz’

* installing *source* package ‘vimp’ ...
** using staged installation
** R
** 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 (vimp)

The issue still may not be summarytools specific, but downloading other packages does not seem to reproduce the problem. Thanks again for all of the help!

dcomtois commented 3 years ago

hmmm strange... if you wish so, you can try with older versions. You can see the available branches here, and you use the branch name as the ref argument, e.g.:

remotes::install_github("dcomtois/summarytools", ref = "0-8-8")

image

For older versions still, you can access them here. Good luck!

PS: Maybe trying devtools::install_github could be tried, although it's unlikely to make a difference.

adam-s-elder commented 3 years ago

Thanks for the help!

It looks like all versions up to and including 0-9-2 work for me.

For versions later than this, I am getting the hanging behavior.