Skip to content

Commit 89e2a53

Browse files
Merge pull request #260 from coding-for-reproducible-research/markdown_r_corrections
Corrections for Markdown in R
2 parents 322ad0f + 2ee5e82 commit 89e2a53

7 files changed

+13
-11
lines changed

individual_modules/Introduction_to_Markdown_in_R/Background_to_Markdown.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A general background to Markdown
1+
# A General Background to Markdown
22

33
## What is Markdown?
44

individual_modules/Introduction_to_Markdown_in_R/Getting_Started_with_Markdown_in_R.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ Completing the above four steps should result in an RStudio window that looks li
4747

4848
### Saving a (new) R Markdown document:
4949

50-
After initialising a new R Markdown document, it can be saved by clicking `File` at the top of the screen and selecting `Save`. Alternatively, the save process can be performed by clicking the <img src = "Embedded_Display_Items/floppy_disk.png" alt = "floppy disk" width = "25" style = "vertical-align:middle;"> button. It is also good practice to repeat the save process regularly when putting together an R Markdown document so that no progress is lost.
50+
After initialising a new R Markdown document, it can be saved by clicking `File` at the top of the screen and selecting `Save`. Alternatively, the save process can be performed by clicking the ![Floppy Disk](./Embedded_Display_Items/floppy_disk.png) button. It is also good practice to repeat the save process regularly when putting together an R Markdown document so that no progress is lost.
51+
52+

individual_modules/Introduction_to_Markdown_in_R/Processing_RMarkdown_Files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Processing R Markdown
1+
# Processing R Markdown Documents
22

33
Throughout this workshop, the gap between what syntax looks like in a `.Rmd` file and how things appear in the final output document has been bridged using vague phrases like "*The HTML output generated upon processing the R Markdown document*...". To be more precise, the overall procedure of going from a `.Rmd` file to a final output document is called **rendering**.
44

individual_modules/Introduction_to_Markdown_in_R/RMarkdown_Components_Embedded_Code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Embedded Code - Components of an R Markdown Document
1+
# Components of an R Markdown Document - Embedded Code
22

33
As mentioned earlier in this workshop, one of the primary benefits of R Markdown is the ability to integrate formatted plain text with R code and its outputs into a single dynamic document. Code can be embedded into R Markdown documents in two different forms:
44

individual_modules/Introduction_to_Markdown_in_R/RMarkdown_Components_Formatted_Text.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Formatted Plain Text - Components of an R Markdown Document
1+
# Components of an R Markdown Document - Formatted Plain Text
22

33
Many of the features that you might implement in other text-based applications like Microsoft Word can also be easily implemented in R Markdown documents. This could range from basic alterations to text aesthetics, through to the addition of tables and images, or even the inclusion of hyperlinks.
44

@@ -82,7 +82,7 @@ output: html_document
8282
This is my very first R Markdown document.
8383
```
8484

85-
Notice how the plain text on the line starting with the `#` now appears blue. This is an example of annotation syntax highlighting in R Markdown, which usefully makes the specific bits of text being formatted stand out. Processing the above in an R Markdown file would then generate a HTML output that displays like the following:
85+
Notice how the plain text on the line starting with the `#` now appears blue. This is an example of annotation syntax highlighting in R Markdown, which usefully makes the specific bits of text being formatted stand out. This is an example of annotation syntax highlighting in R Markdown, which usefully makes the specific bits of text being formatted stand out. Processing the above in an R Markdown file would then generate a HTML output that displays like the following:
8686

8787
![single header](Embedded_Display_Items/single_header.png)
8888

@@ -387,7 +387,7 @@ The above will translate into the below output HTML when processed:
387387

388388
### Task
389389

390-
Below is a HTML output generated using R Markdown that summarises how skeletal muscle adapts to different exercise types. Try to reproduce this in your open R Markdown document. You can check the formatting effects you apply in real time by toggling from `Source` view to `Visual` view in the top left corner of the RStudio script pane. The Google Scholar entry for the utilised journal article can be found [here](https://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=Integrative+effects+of+resistance+training+and+endurance+training+on+mitochondrial+remodeling+in+skeletal+muscle&btnG=). You will need to create a `.bib` file containing the reference and also obtain the URL for the image directly from the journal article webpage.
390+
Below is a HTML output generated using R Markdown that summarises how skeletal muscle adapts to different exercise types. Try to reproduce this in your open R Markdown document. You can check the formatting effects you apply in real time by toggling from `Source` view to `Visual` view in the top left corner of the RStudio script pane. The Google Scholar entry for the utilised journal article can be found by searching the journal title in Google Scholar itself. You will need to create a `.bib` file containing the reference and also obtain the URL for the image directly from the journal article webpage.
391391

392392
#### *Task HTML output:*
393393

individual_modules/Introduction_to_Markdown_in_R/RMarkdown_Components_Visual_Prelude.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A Visual Prelude - Components of an R Markdown Document
1+
# Components of an R Markdown Document - A Visual Prelude
22

33
So far we have installed the `rmarkdown` package for producing Markdown documents in R, and used it to initialise a blank R Markdown document. It is worthwhile noting that, whereas standard Markdown files hold the `.md` file extention, raw R Markdown documents instead carry the `.Rmd` file extension.
44

individual_modules/Introduction_to_Markdown_in_R/RMarkdown_Components_YAML_Header.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# The YAML header - Components of an R Markdown Document
1+
# Components of an R Markdown Document - The YAML header
22

33
## What is the YAML header?
44

55
A YAML header is the very first component worth adding to an R Markdown file. Conceptually, it is a short block of text occuring at the start of an R Markdown file that can be used to define metadata for the file as well as instructions on how the R Markdown file should be processed and how to style the output.
66

77
## What does a YAML header look like?
88

9-
The YAML header is itself comprised of key-value pairs that are enclosed above and below by triple-dash (---) lines. An example YAML header is as follows:
9+
The YAML header is itself comprised of key-value pairs that are enclosed above and below by triple-dash (`---`) lines. An example YAML header is as follows:
1010

1111
```r
1212
---
@@ -54,7 +54,7 @@ output: word_document
5454
---
5555
```
5656

57-
Some output options can be leveraged regardless of output format, whereas other are only valid for specific types of output format. The most common output types and options when defining the `output` key of a YAML header are as follows (sourced from [posit](https://posit.co/wp-content/uploads/2022/10/rmarkdown-1.pdf)):
57+
Some output options can be leveraged regardless of output format, whereas others are only valid for specific types of output format. The most common output types and options when defining the `output` key of a YAML header are as follows (sourced from [posit](https://posit.co/wp-content/uploads/2022/10/rmarkdown-1.pdf)):
5858

5959
![rmarkdown outputs](Embedded_Display_Items/rmarkdown_cheat_sheet_outputs.png)
6060

0 commit comments

Comments
 (0)