Blog Archives

How to add a background image to ggplot2 graphs

October 29, 2016
By
How to add a background image to ggplot2 graphs

When producing so called infographics, it is rather common to use images rather than a mere grid as background. In this blog post, I will show how to use a background image with ggplot2. Packages required The following code will install load and / or install the R packages required for this blog post. if Related Post

Read more »

R Markdown: How to number and reference tables

September 22, 2016
By
R Markdown: How to number and reference tables

R Markdown is a great tool to make research results reproducible. However, in scientific research papers or reports, tables and figures usually need to be numbered and referenced. Unfortunately, R Markdown has no “native” method to number and reference table and figure captions. The recently published bookdown package makes it very easy to number and Related Post

Read more »

R Markdown: How to format tables and figures in .docx files

August 25, 2016
By
R Markdown: How to format tables and figures in .docx files

In research, we usually publish the most important findings in tables and figures. When writing research papers using Rmarkdown (*.Rmd), we have several options to format the output of the final MS Word document (.docx). Tables can be formated using either the knitr package’s kable() function or several functions of the pander package. Figure sizes Related Post

Read more »

R Markdown: How to insert page breaks in a MS Word document

August 16, 2016
By
R Markdown: How to insert page breaks in a MS Word document

RStudio offers the opportunity to build MS Word documents from R Markdown files (.Rmd). However, since formatting options in Markdown are very limited, there is no ‘native’ Markdown code to insert page breaks in the final MS Word output file. In this blog post I explain, how to define page breaks in the RMarkdown document Related Post

Read more »

How to use R for matching samples (propensity score)

June 27, 2016
By
How to use R for matching samples (propensity score)

According to Wikipedia, propensity score matching (PSM) is a “statistical matching technique that attempts to estimate the effect of a treatment, policy, or other intervention by accounting for the covariates that predict receiving the treatment”. In a broader sense, propensity score analysis assumes that an unbiased comparison between samples can only be made when the Related Post

Read more »

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)