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 ( ⎵⎵ ).

Enjoy!

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Share and Enjoy
  • Facebook
  • Twitter
  • LinkedIn
  • del.icio.us
  • StumbleUpon
  • RSS
  • email
  • PDF

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:

library(shiny)
runExample("01_hello")

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: https://xplor.shinyapps.io/module_example_1

The code is available here: https://github.com/samuel-bohman/module_example_1

Comment below if this was helpful to you.

Cheers!

Update!

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: https://xplor.shinyapps.io/module_example_2/

The code is available here: https://github.com/samuel-bohman/module_example_2

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Share and Enjoy
  • Facebook
  • Twitter
  • LinkedIn
  • del.icio.us
  • StumbleUpon
  • RSS
  • email
  • PDF

Beginning vi

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

start vi
vi

quit vi
# quit and save
:x

# quit and save
:wq

# quit vi
:q

# quit without saving
:q!

start insert mode
press i key

turn off insert mode
press (Escape) key

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Share and Enjoy
  • Facebook
  • Twitter
  • LinkedIn
  • del.icio.us
  • StumbleUpon
  • RSS
  • email
  • PDF

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): http://ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Share and Enjoy
  • Facebook
  • Twitter
  • LinkedIn
  • del.icio.us
  • StumbleUpon
  • RSS
  • email
  • PDF

How to install R and RStudio on Ubuntu 16.04.1 Xenial

    Add R repository

sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list

    Add R to Ubuntu Keyring

gpg --keyserver keyserver.ubuntu.com --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
wget https://download1.rstudio.org/rstudio-1.0.44-amd64.deb
sudo gdebi -n rstudio-1.0.44-amd64.deb
rm rstudio-1.0.44-amd64.deb

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Share and Enjoy
  • Facebook
  • Twitter
  • LinkedIn
  • del.icio.us
  • StumbleUpon
  • RSS
  • email
  • PDF