Installing and Configuring R Studio
Installing and Configuring R Studio
This document provides the steps to install R for executing lab exercises. It also gives details to set up R workspace
and install packages.
Steps of R Installation
1. Windows
2. Mac OS X
3. Linux
• For Debian distribution (including Ubuntu), you can install the R system using its regular
package-management tools.
• Since R is open source, you can also compile and install it using source code.
R can be installed on Windows from the CRAN website, or the package can be downloaded from:
https://cran.r-project.org/bin/windows/base/.
To install R on Windows from the RStudio website, the steps to be followed are:
3. Open RStudio.
Environment
Panel
File/Packages
Tab
Viewer
Panel
Console Window: R syntaxes and commands can be written in this window. Besides writing the
commands, this window also shows the results/output and log.
Environment Panel: It provides an activity of recent objects that are created in R session. It also provides
GUI based utilities like importing data from a URL or local system or server.
File/Packages Tab: This tab provides ready access to different folders on local system and server.
Working directory can be set up here. It allows to download CRAN and customized packages to R
system. You can also update packages.
Viewer Panel: RStudio includes a Viewer pane that can be used to view local web content. For example,
web graphics generated using packages like googleVis, htmlwidgets, and rCharts, or even a local web
application created using Shiny, Rook, or OpenCPU.
In RStudio, you can set the workspace by clicking Tools -> Global Options.
You can install an R package by clicking GUI RStudio -> Tools -> Install Packages.
List of R Packages
R Package Function
library() # List available packages to load
library("package") # Load the package
library(help="package") # List package contents
detach("package:pkg") # Unload the loaded package "pkg"
install.packages(“package") # Install the package