knitr fails to compile a PDF document

Using RStudio, RMarkdown and knitr I got the following error when rendering a document in PDF format, while the HTML rendering worked (blank lines are removed):

! Incomplete \iffalse; all text was ignored after line 111.
\fi
<*> /tmp/tex2pdf.16090/input.tex
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on /tmp/tex2pdf.16090/input.log.
pandoc: Error producing PDF from TeX source
Fehler: pandoc document conversion failed with error 43

The problem was related to German locale, particularly the German date format. The head of the RMarkdown source file (Rmd extension) contains some meta data and there one has to escape special characters.

Not working:
---
title: "Title"
author: "Your Name"
date: "6. Oktober 2015"
output: pdf_document
---

Working:
---
title: "Title"
author: "Your Name"
date: "6\\. Oktober 2015"
output: pdf_document
---

As the examples show, it is necessary to escape the dot in the date string. Naturally, the problem affects in general all fields in the header.

The problem is known by the RMarkdown developers but I’m afraid they do not classify it as a bug (Which I can somehow understand).

Using Kenneth Moreland’s Color Map for Scientific Visualization in R

Kenneth Moreland describes in his paper Diverging Color Maps for Scientific Visualization [1] a very usable color map for scientific visualization. In the paper and on his website he gives the decimal values for the used colors (in the RGB color space). However, in order to use the color map in R, it is necessary to know the hexadecimal values of the colors. As I already did the conversion from decimal to hexadecimal, you can download a CSV file with the mapping here.

The pure R code to create a list with the values — which is already the color map — is:
colormap <- c("#3B4CC0", "#445ACC", "#4D68D7", "#5775E1", "#6282EA", "#6C8EF1", "#779AF7", "#82A5FB", "#8DB0FE", "#98B9FF", "#A3C2FF", "#AEC9FD", "#B8D0F9", "#C2D5F4", "#CCD9EE", "#D5DBE6", "#DDDDDD", "#E5D8D1", "#ECD3C5", "#F1CCB9", "#F5C4AD", "#F7BBA0", "#F7B194", "#F7A687", "#F49A7B", "#F18D6F", "#EC7F63", "#E57058", "#DE604D", "#D55042", "#CB3E38", "#C0282F", "#B40426")

Examples how to use your own colors with ggplot are given in Cookbook for R.

[1] Moreland, K. (2009). Diverging Color Maps for Scientific Visualization. 5th International Symposium, ISVC 2009, 92