In this course (note: language to be decided based on the audience), we will learn how to use RMarkdown, a powerful reporting tool in R. Instead of copy-pasting tables, figures, number of patients into Word documents, you will be able to embed the corresponding code directly in your report.
We will prepare a scientific manuscript together, including citations. We will also discuss collaboration for manuscripts written in RMarkdown.
Producing a .docx/.pdf is only one of the many things you can do with RMarkdown. Based on the RMarkdown knowledge adquired in this course, you should be able to start exploring other RMarkdown outputs. We will have a look at reveal.js
which is a framework for producing slides.
All course material will live in this repository, and you're welcome to open issues.
You will need
-
the
rmarkdown
package (install.packages("rmarkdown")
) -
the
broom
package (install.packages("broom")
) -
the
revealjs
package (install.packages("revealjs")
) -
the
knitcitations
package (install.packages("knitcitations")
) -
the
citr
package (install.packages("citr")
) -
the
rmdTemplates
package
# If you don't have devtools installed
# first install.packages("devtools")
install.packages("RefManageR")
library("devtools")
install_github("Pakillo/rmdTemplates")
-
the
ezknitr
package (install.packages("ezknitr")
) -
A tex installation (for pdf output), see this website
Don't hesitate to send me an email or come to my office (campus Mar, sala B) if you have any installation issue.
You just need to know that R exists, how to load data into R, and for instance do a linear regression with R. Don't hesitate to contact me via maelle dot salmon at yahoo dot se if you're not too sure about whether you should come.
We are not going to write any advanced code in the chunks, and starting to learn RMarkdown could be of the first steps of your R journey.
-
RMarkdown basics, we'll create a Hello World RMarkdown.
-
Prepare a manuscript with RMarkdown.
-
Write your (PhD) thesis with RMarkdown? We'll shortly introduce the tools for doing so, and discuss pros and cons.
-
RMarkdown slides with
reveal.js
orBeamer
including discussion of how to keep the corporate identity without the Power Point template.
-
Need more motivation? See this slides
-
RStudio RMarkdown website
-
The link to the RStudio RMarkdown cheatsheet in English and in Spanish I'll also have printed for you and give to you after the course.
-
This paper "Good enough practices for scientific computing" is full of useful tips and won't make you feel bad for not doing everything perfectly.
-
This is another really good paper and it's in Spanish! "Ciencia reproducible: qué, por qué, cómo"
-
This Coursera course about reproducible research is great.
-
Collaboration and version control can be made easier by git and Github. You can have a look at this tutorial from Jenny Bryan and the chapter about git from Hadley Wickham's R package book.
-
We used templates from this package, you can check this one. Link to article about creating a new Word template
-
Furthermore, we haven't covered this idea but one can develop a manuscript as a R package, see this repo and this one.
-
There is a part about RMarkdown and a ton of useful stuff in this book from Hadley Wickham and Garrett Grolemund.
-
Wanna write your thesis with RMarkdown? You can! Use
bookdown
, and look at this repo with a template for a thesis. This blog post is also a nice introduction tobookdown
.
The material of the course from April 2016 about data wrangling in R with dplyr
and tidyr
lives here.