Code Chunks

Exercise

Open the dummy.R (if you’re using R) or dummy.py (if you’re using Python) script from the scripts folder.

  1. Insert a code chunk at the beginning of your document (i.e. below the YAML header) and insert the relevant code from the script to load the necessary packages.
  2. Insert a code chunk in the Results section of your document and copy a piece/section of the dummy script into it.
  3. Run the code chunk and see if it works alright.
  4. Repeat the previous three steps until the whole dummy script has been incorporated within code chunks in your manuscript.
  5. Render the document and check the output.
  6. Play around with the code chunk options and re-render the document.