Line Break in R Markdown Reports / R Notebooks

Lately I have been struggling to find a way to accomplish a line break in an R Markdown Report / Notebook. It is in fact described in the RStudio documentation, but it is rather difficult to find and not so well explained. This is what they have to say about it:

A backslash followed by a newline is also a hard line break.

Easy to overlook, and perhaps not so pedagogical.

What they mean is this:


That is, a backslash ( \ ) followed by two space characters ( ⎵⎵ ).


A Simple Modularized Shiny App

A Shiny module is a piece of code that is included as part of a larger Shiny app. I wrote this small Shiny app as I could not find a really simple example elsewhere. It is based on the “Hello Shiny” example that comes with the Shiny package. You can run it with:


Hello Shiny is a simple application that uses the sidebarLayout, with a sliderInput in the sidebarPanel and a histogram displayed in the mainPanel. My Shiny app modularizes the sidebarPanel part of the sidebarLayout.

You can see it in action here:

The code is available here:

Comment below if this was helpful to you.



Added a second version of modularized “Hello Shiny” that uses renderUI in the module that switches between two sliderInput functions.

You can see it in action here:

The code is available here:

Beginning vi

The default editor that comes with the UNIX operating system is called vi (visual editor). vi is case sensitive.

start vi

quit vi
# quit and save

# quit and save

# quit vi

# quit without saving

start insert mode
press i key

turn off insert mode
press (Escape) key

Failure to download extra data files ttf-mscorefonts-installer

There are many suggested solutions to this persistent problem (for example, here and here). None of them worked for me. However, after some trial and error I found a workable solution described here. Just download and install this Debian software package and see if it works for you too.

Here is the link (just in case):

How to install R and RStudio on Ubuntu 16.04.1 Xenial

    Add R repository

sudo echo "deb xenial/" | sudo tee -a /etc/apt/sources.list

    Add R to Ubuntu Keyring

gpg --keyserver --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -

    Install R-Base

sudo apt-get update
sudo apt-get install r-base r-base-dev

    Install OpenSSL

sudo apt-get install libcurl4-openssl-dev

    Install RStudio

sudo apt-get install gdebi-core
sudo gdebi -n rstudio-1.0.44-amd64.deb
rm rstudio-1.0.44-amd64.deb