CredibilityLab / groundhog

Reproducible R Scripts Via Date Controlled Installing & Loading of CRAN & Git Packages
https://groundhogr.com/
GNU General Public License v3.0
78 stars 4 forks source link

groundhog won't load #93

Closed LukasWallrich closed 1 year ago

LukasWallrich commented 1 year ago

With your latest update, I finally wanted to give groundhog a go as it looks fantastic (and as a package update just broke my code). However, I am failing at the first hurdle.

After installing from CRAN, library(groundhog) simply stalls, in both RStudio and R (both v 4.2.1 and 4.3.0). I cannot install from GitHub, since that stalls at the stage testing if installed package can be loaded from temporary location.

When I try to call functions directly, groundhog::groundhog.library("lavaan", "2023-01-01") got me up to the OK - and then again just stalled. I am on a Mac M2. Any ideas would be appreciated ...

LukasWallrich commented 1 year ago

Now, I'm very confused - I installed the previous version from GitHub (devtools::install_github("CredibilityLab/groundhog", "479f640")) and then ran library(groundhog) - which automatically updated to 3.0.0 which now works ... not sure if something had just broken in my library, or if there is a bug here ...

urisohn commented 1 year ago

Hi Lukas,

Sounds like you fixed it but am curious. What would happen exactly when it "stalled"? It may be too late to look into what happend, but, if you recall anything let me know and share any other details you remember.

V3.0 was a very major update so there a couple of bugs I am fixing and about to release 3.0.1, anything you got is super appreciated.

Uri

LukasWallrich commented 1 year ago

Thanks Uri! By stalling, I just mean that R would get stuck, without displaying anything. Unfortunately, I can't reproduce it now - even after deleting and reinstalling from CRAN, it works, so it probably was an issue with my computer (though it's odd that even updating R and working with a fresh library did not fix it yesterday).

geoffreycastillo commented 1 year ago

I have exactly the same issue: when I do library(groundhog) nothing happens. I am also on Macbook with an M2 processor.

urisohn commented 1 year ago

Ok. I have been fixing a few bugs that were in v3.0.0 and plan to submit to CRAN this afternoon v3.1.0. I think it will fix this issue, but I am not 100% sure what caused it as I could not reproduce it. If you were willing to install the development version (which unless i catch a bug while testing will be v3.1.0) and see if it fixes it that would be great. Or just wait till tomorrow or so for the new version to be on CRAN (but would be great to get confirmation the issue has been addressed).

You can do this install.packages('https://groundhogr.com/groundhog_3.0.0.9005.tar.gz',repos=NULL)

Or install from github with remotes.

urisohn commented 1 year ago

v3.1.0 just submitted. hopefully it resolves this issue.

P-Courtney commented 1 year ago

I am getting a similar issue with the following warning. All other packages are loading normally. Apologies if this is a fault on my end, I am relatively new to R:

library("groundhog") Error: package or namespace load failed for ‘groundhog’: .onLoad failed in loadNamespace() for 'groundhog', details: call: readRDS(cran.times.path) error: error reading from connection In addition: Warning message: In readRDS(cran.times.path) : lzma decoding result 10

urisohn commented 1 year ago

I think that's a different issue. Which version of R, operating system, and version of groundhog do you have?

P-Courtney commented 1 year ago

Thank you for the reply. I am uninstalling and reinstalling groundhog afresh.

MacOS: 13.3.1 (22E261) platform aarch64-apple-darwin20
arch aarch64
os darwin20
system aarch64, darwin20
status
major 4
minor 2.2
year 2022
month 10
day 31
svn rev 83211
language R
version.string R version 4.2.2 (2022-10-31) nickname Innocent and Trusting

urisohn commented 1 year ago

OK. Thanks. So, groundhog is trying to read a file and cannot. That's the error that's being generated. One possibility is that the folder got corrupted at some point, or you don't have permission to read from it, or you are not able to download the file due to firewall.

Possible solution 1. Set a new groundhog folder, do groundhog::set.groundhog.folder(<path>) to a path you are confident you are allowed to save to. Then see if you can run normally

Possible solution 2. If something got corrupted, you can also try deleting the folder telling groundhog where to look for files.

path1<-paste0(path.expand("~"),"/R_groundhog")  #this is a folder that only has groundhog files
unlink(path1,recursive=TRUE)                                    #this deletes it

This second solution may work if you had an earlier version of groundhog and something went wrong while updating.

Possible solution 3. If you carry that out, and still it cannot load, verify a manual download works, to see possible issue reading the file more generally

download.file('http://s3.wasabisys.com/groundhog/cran.times.rds' , 'cran.times.rds')
cran.times<-readRDS( 'cran.times.rds')

and see if the file downloads and reads properly

I don't have a good idea of what may be going wrong, so these are just intuitive guesses to be able to diagnose the issue.

If neither of these work, please clarify exactly when the error is happening. So you do install.pacakge('groundhog') and then library('groundhog') is already failing?

Also worth deleting variables in the environment, restarting R session and R Studio in case something in the environment is preventing the normal functioning of groundhog or other underlying processes.

P-Courtney commented 1 year ago

Thanks, Solution 2 worked!

P.S. I really love groundhog, thank you! And your work at Data Colada.

urisohn commented 1 year ago

Glad to hear it. Thanks

geoffreycastillo commented 1 year ago

I can confirm that v3.1.0 fixed my issue with an Apple M2 🎉 (sorry for not answering earlier)