Skip to main content

Section B.7 Extras

As stated many times in this book, there are a bevy of different things that are possible in R, and R Markdown is no different. Here are a couple of additions you can add to your R Markdown document to spice it up.
Mind you, there are more additions you can add to your R Markdown document even relating to the sections below. This is just meant to be an introduction.

Subsection B.7.2 Pictures

In chapter 3, I showed you all a picture of a Adelie penguin. Below is the code I used to display the image:
![A picture of a Adelie penguin.](Adelie-Screenshot.png)
The formula for this goes:
  • !: Letting R know that you’re about to add a picture.
  • []: Providing a description for the picture for people unable to see the picture.
  • (): The link to the picture.
    • The image needs to live in the same part of your computer that your R Markdown file lives.

Subsection B.7.3 Checklists

In most of the chapters in the textbook, a checklist at the end is provided. This is to help you along your analyzes to make sure you’re hitting all of the major components of the analysis.
To create a checklist, is it quite similar to how to create lists. Below is an example:
- [ ] Identified both variables as **categorical** (not numeric)?
There is still a -, followed by a space. However, after the space is [] with a space separating the two brackets. This space is so you can click inside the checkbox.

Subsection B.7.4 Standout sections

Many times in this book, specific questions/texts have been singled out. My favorite one, stemming all the way from chapter 1, is:
R puts the r in Artist.
To do this, all you need is the > on its own line. The code looks like this:
> R puts the r in Artist.
Simple as that! This can be a vital addition when used correctly.

Subsection B.7.5 Changing Setting of Specific R Chunks

To the right of each R chunk there is a circular gear icon. Here is where you can change some of the setting of each R chunk. There are a three things you see:
  1. Chunk Name: This is where you can also name your chunk
  2. Output: This is where you can control the output of the specific R chunk. It is by default set to the document default, but this can be altered for individual R chunks.
  3. Slider options: You can further customize the output of an individual R chunk this these four options. You’ll mostly be interested in the first two, as they’re typically the most powerful. For instance, when you first load tidyverse a big message appears, which you can stop by switching "Show messages" to the left.
Each R chunk is unique and requires different settings based upon what is inside and what you want the viewer to see from it.