Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
RStudio
1. RStudio
RStudio is a free and open source integrated development environment (IDE) for R, a programming
language for statistical computing and graphics. RStudio was founded by JJ Allaire, creator of the
programming language Clod Fusion. Work on RStudio started at December 2010, and first public beta
version(v0.92) wasofficiallyannouncedinFebruary2011. RStudiocombinesasource code editor, build
automation tools and a debugger.
We recommend you install both R and RStudio on your computer.
Using RStudio:
We will reverse things slightly by beginning with the process of starting RStudio, and postpone any
installationissuesforabit.As RStudiocan be used from the desktop or through a server, there are two
ways of starting it.
Desktop Version:
RStudio is started like most other applications. For windows, the installations process leaves a menu
items. There it was started by clicking on its icon. Its use for Windows, Mac and Linux.
Server Version:
Startingthe serverversionrequires one to know the appropriate URL for the resource. We used a local
URL for any task, but the real value comes from using RStudio as a resource on the wider internet.
Whish R?
RStudio does not require a special version of R to run, as long as it is a fairly modern one. It will work
with binary version from CRAN or user compiled version.
Installing RStudio:
InstallingRStudioisusuallyastraightforwardprocess.First,RStudiorequire aworking relativelymodern
R installation. If that is not already present, then one should consult http://cran.r-project.org to learn
how to install R for the given operation system.
Using projects:
To organize our work, we set up a new project. RStudio allows us to compartmentalize our work into
projectsthathave separate global workspacesandassociatedfiles.We easilynavigatebetweenprojects
using a selector (a combo box) in the main toolbar located in the upper right corner.
2. Reading in a Data file:
Clickingonthe data file name inthe file browser opens up a system text editor, allowing us to edit the
file. For many text based files, the file will open in RStudio’s source code editor.
Debugging R code in RStudio:
R providessome usefultoolsfordebuggingR code,summarizedonline fromwebsite. These tools allow
R users to investigate errors, step through functions, insert debugging code, etc.
Source Code Editor:
Recall that RStudio leverages numerous web technologies. A major one is that Ace is written in Java
Script, which allows all necessary computations to be done in the Client, thereby avoiding numerous
calls to the Server.
Using the Right Class to Store Data:
The data is time-series data, but the data and time are read in and stored by read.csv as factors, not
time. R has many different classes for working with time-series data.
Importance of RStudio:
RStudiohasveryimportantincomputerfield,becausewe make projectsonthissoftware.This software
has Source code editor, debugging tools and many more.
Adeel Rasheed