Princeton University
2023-09-18
tidyverse
you already have R markdown!tinytex
Input side:
Output side:
HTML
DOC
- Francesca Gino
Welcome to my awesome class. You will learn all kinds of useful things about R markdown.
…and on
…and on
…and on
You may also want to use a bulleted list!
like
this
one
<https:://placekitten.com/200/300>
[Kittens](https:://placekitten.com/200/300)
Local images
![](./img/)
![]https:://placekitten.com/200/300)
title: "My First R Markdown Document"
author: "Jason Geller"
date: "9/15/2021"
output: html_document
title: "My First R Markdown Document"
author: "Jason Geller"
date: "09/15/2023"
output:
pdf_document: default
html_document: default
- Notice the indentation - YAML is very picky about this
output:
html_document:
theme: readabl
Possible themes: default, cerulean, journal, flatly, darkly, readable, spacelab, united, cosmo, lumen, paper, sandstone, simplex, yeti
output:
html_document:
toc: true
toc_float: true
$
is treated as “inline” maths$$
is a standalone equation$x$
is an equation, $x $
is notThis \(x^2\) is inline
This equation is standalone \[\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i\]
Explicitly link R code to output
Wide variety of formats
Increases transparency
Increases efficiency
One fairly new feature (and one reason we’re using RStudio today!) is their new visual markdown editor. It’s basically an ultra powerful hybrid of Markdown and Microsoft Word. But be warned, it’s a little buggy if you frequently switch editing modes.
People write whole books in Markdown, and this may make that seem a little more achievable. For example, the new visual editor allows easy citation management with a Zotero library
…and on
…and on
…and on
You may also want to use a bulleted list!
like
this
one
To emphasize your point you might want to use italics or bold.
To have something appear as code (using a monospace font), surround everything that is code with ticks `like this`, so that it shows up like this
.
For example, this R code:
Call-out blocks highlight sections of text that interrupt the flow of your regular text. Maybe it’s a definition, a warning, or a sidenote
When rendering your document to HTML, callout blocks are interactive and can be collapsed and opened.
My First Callout Block!
Say things here
Note
Note that there are five types of callouts, including: note
, tip
, warning
, caution
, and important
.
Warning
Callouts provide a simple way to attract attention, for example, to this warning.
This is important
Danger, callouts will really improve your writing.
Tip with caption
Caution, under construction
Here is something under construction
Expand To Learn About Collapse
This is an example of a ‘folded’ caution callout that can be expanded by the user. You can use `collapse=“true”` to collapse it by default or `collapse=“false”` to make a collapsible callout that is expanded by default.
{r, eval=TRUE}
has been replaced with #| eval = TRUE
[1] "Don't Run Me"
Split up and flip between sections of a page, alternative to just two columns
# Install latest CRAN release
#install.packages("papaja")
# Install remotes package if necessary
#if(!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")
# Install the stable development version from GitHub
#remotes::install_github("crsh/papaja")
# Install the latest development snapshot from GitHub
#emotes::install_github("crsh/papaja@devel")
Quarto version of PAPAJA
PSY 503: Foundations of Statistics in Psychology