Data reports. What’s that again?
(Munroe 2021)
Two models of work.
Center of your project: Word file
Center of your project: repository
Getting Started.
https://rmarkdown.rstudio.com/articles_intro.html (Grolemund 2014)
https://daringfireball.net/projects/markdown/basics (Gruber 2004)
Create a basic document with the following content
---
output:
pdf_document: default
html_document: default
---
# Say Hello to markdown
Markdown is an **easy to use** format for writing reports.
It resembles what you naturally write every time you compose an email. In fact, you may have already used markdown *without realizing it*. These websites all rely on markdown formatting
## Subheading
Fantastic!
* [Github](www.github.com)
* [StackOverflow](www.stackoverflow.com)
* [Reddit](www.reddit.com)
* and surely others do as well!
# Chapter Two Starts Here
Let me cite some clever person:
> Dorothy followed her through many of the beautiful rooms in her castle.
Now, adjust the header of the file:
Now, for the best part, add this to the end of your document:
## What is cool about R Markdown
It is easy to show what you did by including code and output of code. The max speed of a car in our database is `r max(cars)`mp/h. We have `r nrow(cars)` cars in our dataset.
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
To use references, adjust the header and end of your document:
…create a references.bib
file…
@book{2020-healy-plain_text,
author ={Healy, Kieran},
title= {{The Plain Person’s Guide to Plain Text Social Science}},
url={https://plain-text.co/},
publisher={The Internet},
year={2019}
}
…and download
the apa.csl
here (or look for
more )
read.csv
tab
-separatedplot
-functiontemperature
on x-axis,
pressure
on y-axisAnd please take a look at the next slide
In case you face issues installing rmarkdown
package on
Windows
You need to install RTools: https://cran.rstudio.com/bin/windows/Rtools/
And please check
download.file("https://cran.rstudio.com/src/contrib/PACKAGES", "text.txt")
if that results in an error:
In download.file(“https://cran.rstudio.com/src/contrib/PACKAGES”, : URL ‘https://cran.rstudio.com/src/contrib/PACKAGES’: Status war ‘SSL connect error’
Then this helps:
options("download.file.method"="wininet")
and after that install rmarkdown
package
Advanced Usage:
https://plain-text.co/pull-it-together.html#pull-it-together (Healy 2019)