^^ YAML header
I did not know we had to share the document so if you’re reading this I’m sorry
A document type used to write technical reports. It weaves in text (markdown) and chunks of code (R), which could then be exported in html, pdf, or word format. This way of report-writing increases reproducibility and flexibility.
Word files (aka “raw file”) contains a lot of formatting files, which buries the text and makes the internal code “unreadable”. Conversely, markdown allows plain text writing in the raw file, making it human-readable, while simultaneously allowing formatting.
It can also be written in simple text editors like notepad.
In terms of utility, markdown can be used to make blogs, resumes, academic papers, etc.
Type this:
# * italics *
# ** bold **
# ** bold-italics ***
Ignore the apostrophes
for example:
indent twice
# one
## two
### three
#### four
##### five
###### six (max)
Upload local file into work space by clicking “more” on the file’s tab toolbar, then opening another files window where the picture is before dragging the image directly into the project file window.
Afterwards, type this:
# 
In this example, I used the “more” button to open the “3361_dump” file in a file window before opening the “pictures” file in a separate window. I then dragged the desired picture (Zayne my bbg) into the 3361_dump file window. The picture file immediately loaded into the file tab within R studio without refreshing.
Gorgeous, innit?
Use the same command(?) as the local file, but replacing the file name with the link address of the image.
ZAYNE RAHHHHHHHHH
^ this is a “block quote”
Markdown formatting language. Output to different files with by changing name in output into ‘html_document: default’/ ‘pdf_document:default’. The most recent exported file type will be set on top in the output section.
You can delete ‘default’ and add ‘theme:…’ to apply different theme in output.
Possible themes: default, cerulean, journal, flatly, darkly, readable, spacelab, united, cosmon, lumen, paper, sandstone, simplex, yeti
E.g.,:
# title: "3051 dump Rmd"
# output:
# html_document:
# theme: readable
#date: "2024-05-21"
YAML is very strick on indents and spaces
# title: "3051 dump Rmd"
# output:
# html_document:
# toc: true
# toc_float: true
# theme: readable
#date: "2024-05-21"
“toc_float: true” makes a dynamic table of contents that stays visible wherever you scroll. ‘False’ makes a static TOC at the top of the page.
NOTE: using toc_float in viewer panes makes the preview jittery.
Type:
# $ = inline maaths
# $$ = standalone equation (e.g., $e=mc^2$)
E.g.:
Inline: \(1+2=3\)
Standalone equation:
\[ a^2 + b^2 = c^2 \] Use symbol names preceded by ’ ’ with dollar signs to make symbols:
\[ \Psi + \delta + \alpha \] You can type superscript ( x^{} ) and subscript ( x_{} ); fraction is not an option by default, you will need to install the amsmath package for it
\[ MSB_{A} = SS_{A} \div df \]