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

Quarto getting stuck with groundhog.library() #85

Closed rafaelcharris closed 1 year ago

rafaelcharris commented 1 year ago

Hello everyone,

This is more of a quarto + groundhog problem.

I am trying to use groundhog for everything at work. However, something is wrong now that I am trying to create a quarto document.

I am trying to render a document with the following code:

# If groundhog is not installed, do it.
if (!"groundhog" %in% rownames(installed.packages())){
  install.packages("groundhog")
}

library('groundhog')
pks <- c("sf", "spdep", "dplyr", "reshape2", "ggplot2", "INLA", "tidycensus", 
         "tigris")

groundhog.library(pks,'2023-01-01')

But the file is not rendering! It gets stuck with only this chunk. Has anyone had this problem or know what might be going on?

Let me know if this is not the space to post this doubt, and thank you in advance.

urisohn commented 1 year ago

I don't use quatro, but if you share some sample code i can try it out.

rafaelcharris commented 1 year ago

Hi Uri,

Thank you for responding.

If you create a Quarto file with nothing but the code I posted in my first comment, it should get stuck.

Let me know if get to try it.

Rafael

urisohn commented 1 year ago

I was able to run groundhog without a problem on quatro, but that package INLA in your list is not a CRAN package so cannot be installed with groundhog. You can install it from github or gitlab too if it is available there. If not, you cannot use groundhog to install it. I wonder if that's the issue. Screenshot 2023-01-31 124941

Note how my code compares pkgs you wanted to load with those successfully loaded finding that all of them loaded successfully, except for INLA which I removed by hand

(groundhog produced this error by the way for it: image

Perhaps INLA was not the root cause, since i do not seem to reproduce the problem you are having?

rafaelcharris commented 1 year ago

mm Thank you, Uri.

It is important information that INLA is not a CRAN package. I was unaware, but you are right. That does not seem to be my problem.

For some reason, I changed the order of the packages in groundhog in the pks vector and the document rendered. I took spdep out of the second position and it worked.

I don't understand why that would change anything and why it would work for you as it was... I am using a mac with the m1 chip. I don't know if that can have an impact on that.

It's working now with the new order, though.

Thank you for taking the time to look at this, Uri.

urisohn commented 1 year ago

OK glad it is working.