Installation and Setting Up
Learn how to install and set up R.
We'll cover the following
Installation
As an open-source software for statistical computing, R can be easily downloaded from the following site: http://www.r-project.org/. We may simply click on the highlighted download R link to reach a list of CRAN mirror sites. Clicking on any site we prefer directs us to the page for downloading the software for three different platforms: Linux, Windows, and Mac. R works slightly differently across three platforms. For the purpose of this book, we will focus on the language and functionality specific to the Windows platform.
R is constantly being updated to new versions by developers. It is worth noting that some R programs and packages used in this course could require 3.3.2 or newer. If the version of R on a machine is not up to date, one may simply uninstall the old version and install the latest version following the procedures described previously,
or refer to the subsection on how to update R in the Miscellaneous Q&A Section.
Learn to find and set a working directory for a project
When we open R, the default interface is the R Console page, which is based on the interactive mode. To create an R program, we should go to the R Editor page. To do so, we can open R, click on File on the menu bar, and then click on New script to open the R program editor. Now, click on the Save button on the menu bar or the Save option under File, and we will be prompted to enter a filename for an R program file that ends with .R
. For an experiment, name the file session1.R
(remember to end it with .R
), and then save the file in the Project folder.
Get hands-on with 1400+ tech skills courses.