Skip to main content

Section 10.12 Common Rendering Errors and How to Fix Them

  • Object not found: An object is used before it is created.
    • Fix: Make sure all objects are defined earlier in the document and not only in the R environment.
  • Missing package: A required package is not loaded or installed.
    • Fix: Load all necessary packages inside the Quarto document using library().
  • Duplicate chunk labels: Two R chunks share the same name.
    • Fix: Ensure every R chunk has a unique #| label:.
  • File not found: An image or data file cannot be located.
    • Fix: Check file names, capitalization, and that files are stored in the correct directory.
  • Code runs in console but not when rendering: The document relies on objects outside the file.
    • Fix: Restart R and render the document to confirm it runs in a clean session.