### Packaging Project Files for Publisher - Shell Source: https://github.com/hadley/adv-r/blob/master/README.md This shell script prepares the 'Advanced R' book's source files for publishing. It creates a 'crc' directory, copies all necessary book components including LaTeX files, bookdown generated files, diagrams, screenshots, emoji, and other assets, then removes specific temporary files before zipping the entire 'crc' directory into a single archive. ```Shell 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 ``` -------------------------------- ### Initializing Google Analytics with gtag.js (JavaScript) Source: https://github.com/hadley/adv-r/blob/master/ga_script.html This snippet initializes the Google Analytics `dataLayer` and configures the `gtag.js` library. It sets up the global `gtag` function, sends a 'js' command with the current date, and configures a specific Google Analytics tracking ID (UA-141212623-1) for data collection. ```JavaScript window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-141212623-1'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.