The Holy Grail
Full details of any results reported and the methods and data used to obtain them should be made available, so that others following the same methods can obtain identical results.
Rmarkdown is open source software for dynamic report generation with R, enabling integration of R code into PDF, HTML, and MS Word documents. Effectively it embeds R code into documents.
(p. 104 of the Russell Report)
---
title: "RMarkdown"
author: "Chris Brunsdon"
date: "17 November 2015"
output: html_document
---
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax
for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see .
When you click the **Knit** button a document will be generated that includes
both content as well as the output of any embedded R code chunks within the document.
You can embed an R code chunk like this:
```{r hello}
print('hello world!')
```
.Rmd
# Subject
- Highest Level Header
## Less important subject
- Next level down### Even less important subject
- Next level down#### Trivia
- Lowest level
- Include an image in document<http://rmarkdown.rstudio.com>
- Include clickable link to URLEvaluate but don’t echo in the document:
```{r hello,echo=FALSE}
print('hello world!')
```
Graphics are directly embedded - just include the plotting code
```{r randomplot,echo=FALSE}
x <- seq(-1,1,length=21)
y <- x*x + rnorm(21)/10
plot(x,y)
```
So are plotly
commands
```{r rain_graph,echo=FALSE}
p %>% layout(title="Phoenix Park Rainfall",
yaxis=list(title="Monthly Total (mm)", showline=TRUE,tickangle=-90)) -> p2
p2
```
and ggplot
commands
```{r station_map,echo=FALSE}
rain %>% filter(Year > 1980,Station %in% c('Birr','Valentia','Belfast','Dublin Airport')) %>%
highlight_key(~Year,"Year") -> rain_hy2
ggplot(rain_hy2,aes(x=Month,y=Rainfall,group=Year)) + geom_line(col='grey50') +
geom_point(col='seagreen') + facet_wrap(~Station,ncol = 2) + labs(y='mm rain') -> plot_ky2
ggplotly(plot_ky2,tooltip='Year') %>%
highlight(on = "plotly_click", off = "plotly_doubleclick",color='navy')
```
#reproducible
Modify the header
---
title: "My Life as a Hell's Angel"
author: "Daniel O'Donell"
date: ""
output:
ioslides_presentation:
widescreen: true
---
Bullet points
- Level 1
- Level 2
- Still level 2
- Back to level 1 *italic*
- Still level 1 **bold**
publish
option in the top right of the windowpublish
gives your article a web site
Create an Rpubs blog showing how to create a monthplot
of the mean rainfall data for Ireland on a month-by-month basis from January 1970 to December 1979, and briefly describing the patterns in the plot.