• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Finance Train

Finance Train

High Quality tutorials for finance, risk, data science

  • Home
  • Data Science
  • CFA® Exam
  • PRM Exam
  • Tutorials
  • Careers
  • Products
  • Login

Installing and Using RStudio with R

Data Science

Getting Started with R Programming Installing and Using RStudio with R

While R comes with a neat console that you can use for all your R programming needs, you can compliment it with RStudio which is a Gui built on top of R and makes it very easy to manage your programming requirements.

Installing RStudio

You can download RStudio from the following link:

https://www.rstudio.com/products/rstudio/download3/

On the page you will come across multiple choices for downloading the software.

  • From a licensing perspective, there is a personal license (which is free) and then there is a commercial license. For our purpose, you need the personal license.
  • Also, there are two versions for the software: 1) RStudio Desktop and 2) RStudio Server. For now, you just need to download RStudio Desktop.

So, among all the choices available, you will need to download RStudio Desktop with Personal License.

When you click the download button, it will present you with a choice of download files. You must download the file suitable for your operating system.

It is preferred to download Installers rather than Zip/Tarballs or Source Code.

Click the relevant file and the download will begin.

Once the installer is downloaded, click on it and install it. Follow the onscreen instructions to complete the installation. Once installed, open the application and now you’re running RStudio.

You can quickly try some arithmetic to get the idea of how to use the interface.

For example:

  • CTRL+L to clear the console
  • 3+5 to calculate the sum of 3 and 5
  • 26%%3 to calculate the 26 modulo 3.

Your RStudio screen should now look something like this:

RStudio Orientation

RStudio being a Gui makes working with R very user-friendly and allows you to execute basic commans without writing commands manually. This includes things like opening a script, import/export .csv files, manage R packages, get help, etc. In general, it accelerates and simplifies these general tasks.

Let’s take a look at the RStudio screen and how it is organized.

R Studio Interface
R Studio Interface
  1. The upper left window is the script section where you write all your code.
  2. The upper right window is the environment. This is the place where all the objects you create in your current R session al listed. For example, all datasets you have loaded will appear here, along with any other objects you have created (special text formats, vectors, etc). If you click on the History tab, you will see the complete history of code you have typed, over all sessions
  3. The lower left window is the R console. This is the same as the R console we have already seen. This is the place where the actual calculations take place. The script section sends the code to the console when you click the ‘Run’ button in the script section. Just like you did in R Console, you can also write the code directly in R Console, but that’s not effective as you cannot manipulate it.
  4. The lower right window contains five tabs.

Files

This tab shows you all the files you have saved in your RStudio account. The buttons across the top of the tab allow you to upload additional files, delete files, rename files, and many more functions.

Plots

When you run code in the Console that creates a plot, the Plots tab will be automatically selected. Any time you want to view plots, you can select this tab manually, but it will be selected when you run plot code. Notice the arrow buttons at the top left of the pane; these allow you to scroll through all the plots you have created in a session.

Packages

This tab allows you to see the list of all the packages (add-ons to the R code) you have access to, and which are loaded in already.

Help

This tab will be automatically selected whenever you run help code in the Console, but you can access it at any time by clicking on the tab.

help(plot)

Viewer

RStudio includes a Viewer pane that can be used to view local web content. We will not be using this till much later in the course.

As we go along in the course, you will get more familiar with RStudio and various features it offers.

When you first start RStudio, you may not see the script window. You can create a new script window, by just clicking the ‘New Script’ button, as shown below:

Previous Lesson
Back to Course
Next Lesson

Primary Sidebar

In this Course

Course Home
Installing R Software on Your Computer
Performing Basic Math Operations in R
Setting Up a Working Directory in R
Installing and Using RStudio with R
Using Variables in R
Data Types in R
Creating and Using Vectors in R
Matrices in R Programming
Factors in R Programming
Return to Getting Started with R Programming

Latest Tutorials

    • Data Visualization with R
    • Derivatives with R
    • Machine Learning in Finance Using Python
    • Credit Risk Modelling in R
    • Quantitative Trading Strategies in R
    • Financial Time Series Analysis in R
    • VaR Mapping
    • Option Valuation
    • Financial Reporting Standards
    • Fraud
Facebook Group

Membership

Unlock full access to Finance Train and see the entire library of member-only content and resources.

Subscribe

Footer

Recent Posts

  • How to Improve your Financial Health
  • CFA® Exam Overview and Guidelines (Updated for 2021)
  • Changing Themes (Look and Feel) in ggplot2 in R
  • Coordinates in ggplot2 in R
  • Facets for ggplot2 Charts in R (Faceting Layer)

Products

  • Level I Authority for CFA® Exam
  • CFA Level I Practice Questions
  • CFA Level I Mock Exam
  • Level II Question Bank for CFA® Exam
  • PRM Exam 1 Practice Question Bank
  • All Products

Quick Links

  • Privacy Policy
  • Contact Us

CFA Institute does not endorse, promote or warrant the accuracy or quality of Finance Train. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.

Copyright © 2021 Finance Train. All rights reserved.

  • About Us
  • Privacy Policy
  • Contact Us