Chapter 1 Installation
Date: Start of the year, during the basic mathematics course.
Topic: Programming
Duration: 30–60 min.
Throughout this portfolio, we will use RStudio. To use RStudio, you need to install both R and RStudio.
(Even if you have an existing version, I recommend getting the latest version using the guide below.)
1.1 Installation Guide
If you’re comfortable with computer software, it boils down to:
- Install R;
- Install RStudio;
- Open RStudio and try to knit a template R markdown file.
If you can’t knit to PDF, see the note below and try knitting to HTML instead.
Note about TinyTeX
TinyTeX is not required for the portfolio. With TinyTeX, you can knit to PDF. This has several advantages over HTML and Word, which are explained in the second video. For the portfolio, all you need is a working version of RStudio, and to be able to knit to Word.
Note about installation problems
Address installation issues early on. If you’re following this portfolio in the context of your biology education at Leiden University, you can always contact Dr. H.G.J. van Mil or me about installation issues.
Otherwise, see the general tips below, or try asking a question on Stackoverflow.
Some general tips that will save you a lot of headaches with software during your education:
- Setting your system language to English (Windows, Mac) makes everything a lot easier to find;
- If you store data in Excel, setting the decimal separator to a dot (.) instead of a comma (,) will also save you a lot of extra effort;
- If you are on Windows, I highly recommend working on an account with administrator rights and setting user account control to “Never notify”. (Link says Windows 7 & 8, but it works the same for Windows 10.)
1.2 The RStudio interface
Watch the video on the RStudio interface below.
Question:
As a simple checklist, see if you can do the following:
- Create a new R markdown file;
- Delete everything that is not the preamble;
- Create a new code chunk and write some simple code like
1 + 1
; - Run the code.
- Try to knit the document to HTML, Word or PDF.
From here on I will assume basic familiarity with the RStudio interface.