Advanced R Book Source

repository·master·Indexed 25 days ago

https://github.com/hadley/adv-r

Source code and text for the 'Advanced R' book, built using the bookdown framework. Includes technical specifications for creating diagrams with Omnigraffle, RMarkdown configuration for image inclusion, and procedures for packaging source files for the publisher.

Tokens
469
Snippets
1
Records
3
Agent score
32%

What's inside Advanced R

  1. Package source files for the publisher

    master

    Use the following sequence of commands to prepare a zip archive containing the necessary source files for the publisher. This process collects the LaTeX main file, RMarkdown dependencies, diagrams, screenshots, emojis, and specific class/bib files into a crc directory before zipping.

    mkdir crc
    cp _book/_main.tex crc
    cp -r _bookdown_files/*_files crc
    cp -r diagrams crc
    cp -r screenshots crc
    cp -r emoji crc
    cp mina.jpg crc
    cp krantz.cls crc
    cp book.bib crc
    rm crc/diagrams/*.graffle
    
    zip -r adv-r-source.zip crc
  2. Configure RMarkdown for diagram inclusion

    master

    To correctly include diagrams in RMarkdown chunks for this project:

    1. Avoid manual DPI: Remove the dpi specification from include_graphics(). Instead, rely on the configuration in common.R.
    2. Width settings: Set the chunk option output.width = NULL.
    3. Cache management: If you change the size of an image, you must clear the RMarkdown cache to ensure the updated image is correctly rendered.
  3. Prepare diagrams for Advanced R using Omnigraffle

    master

    When creating diagrams for this project using Omnigraffle, follow these technical specifications to ensure they render correctly in the book:

    • Scaling & Resolution: Set scale to 100% (ensure 100% is 'one postscript point' so canvas size matches physical size). Export at 300 dpi scaled to 100%.
    • Grid & Padding: Use a 1cm grid with 10 minor units. Include 2mm padding on all sides.
    • Typography: Use inconsolata 10pt for text (with text padding set to 3). Use Apple Color Emoji 8pt for emojis.
    • Visual Styles:
      • Default scalar size: 6mm x 6mm.
      • Symbols: 4pt rounded corners with a plum border.
      • Arrow heads: Set to 75%.
      • Names: Use steel color.