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.1 Links
Like most documents, in R Markdown, you are able to add links for your views to be directed to. This was actually done in the introduction to R chapter with the link to all of the CRAN packages. The formula for adding a link is this
-
[]: What you want the link you click on to be displayed as. -
(): The link you want viewers to be directed to.
This is what the code looks like:
[here](https://r-packages.io/packages).
What is inside the brackets is what the viewers see, and then what is inside the parenthesisβ is the link theyβll be directed to if they click on the link.
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:

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:
-
Chunk Name: This is where you can also name your chunk
-
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.
-
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
tidyversea 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.
