nceas-coding-club / nceas-coding-club.github.io

data-science-chats collaborative website created using Quarto as a way of learning Quarto together!
https://nceas-coding-club.github.io/
5 stars 2 forks source link

Better Framework For Data Byte/Recipe Package Installation #28

Open njlyon0 opened 1 year ago

njlyon0 commented 1 year ago

Problem

Solution(s)

cullen-molitor commented 1 year ago

I have been going with the following lately which I rather like:

if (!require(librarian, quietly = T)){
  install.packages('librarian')
}

librarian::shelf(
  tidyverse,
  here,
  quiet = T
) 
camilavargasp commented 1 year ago

Run into this issue when rendering the website, and I did not have ggsvg installed. I updated the ggsvg.qmd with Cullen's suggestion. The only thing to remember is that if the package is being installed from GitHub you need to add the user name and package name.

image

The code looks like this

# load libraries
if (!require(librarian, quietly = T)){
  install.packages('librarian')
}

librarian::shelf(
  tidyverse,
  here,
  palmerpenguins,
  coolbutuseless/ggsvg,
  quiet = T
)