1

I'm trying to compile r4ds book with quarto render.

However some files have some problems that need fixing.

The problem is that, every time I run quarto render, the compilation starts over from the beginning.

Is there a way to continue the compilation from the last broken file?

For example, if the compilation stops at webscraping.qml, to restart from there?

2
  • This might help. Commented Jul 17, 2023 at 7:34
  • The quarto documentation on Managing Execution - in particular, "freezing" and maybe "caching" - seems like it might be helpful for your case. Commented Jul 19, 2023 at 14:14

1 Answer 1

0

I used the following script to install the missing libraries:

# Set the CRAN mirror (you can choose a different mirror if needed)
options(repos = c(CRAN = "https://cloud.r-project.org"))

# List of required packages
required_packages <- c("tidyverse", "arrow", "dbplyr", "duckdb", "scales", 
                       "ggrepel", "patchwork", "nycflights13", "palmerpenguins", 
                       "ggthemes", "DBI", "tidymodels", "ggridges", "leaflet", 
                       "shiny", "repurrrsive", "jsonlite", "babynames", "readxl", 
                       "writexl", "googlesheets4", "rvest", "dplyr")

# Function to check and install missing packages
install_if_missing <- function(packages) {
  installed <- installed.packages()[, "Package"]
  for (pkg in packages) {
    if (!pkg %in% installed) {
      install.packages(pkg, dependencies = TRUE)
    }
  }
}

# Install missing packages
install_if_missing(required_packages)

As suggested by @Matt-Summersgill, I used to following options in _quarto.yml:

project:
  type: book
  output-dir: _book

execute:
  freeze: true
  cache: true
  
book:
  title: "R for Data Science (2e)"
  reader-mode: true
# ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.