An introduction to R and RStudio

Instructions:

Use the left and right arrow keys to navigate the presentation forward and backward respectively. You can also use the arrows at the bottom right of the screen to navigate with a mouse.

FAIR USE ACT DISCLAIMER:
This site is for educational purposes only. This website may contain copyrighted material, the use of which has not been specifically authorized by the copyright holders. The material is made available on this website as a way to advance teaching, and copyright-protected materials are used to the extent necessary to make this class function in a distance learning environment. The Fair Use Copyright Disclaimer is under section 107 of the Copyright Act of 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education and research.

Outline

  • The following topics will be covered in this lecture:

    • What is R and RStudio
    • How do we write code?
    • How to install packages
    • How to get help in R

Introduction

  • This course will lean heavily on programming;

    • while it is possible to perform statistical analyses by hand for some very simple “toy” problems, realistic problem solving must be done on a computer.
  • This course does not assume that you are already familiar with programming;

    • this course will also not require a deep knowledge of programming or computer science.
    • However, everyone is responsible to learn enough R to become proficient with standard modeling and plotting functions.
  • Students are recommended to use the lessons in Sofware Carpentry as a free reference for scientific programming in R.

What is R?

  • There are a number of common choices of programming/ scripting languages for performing statistical modelling, e.g.:
    • SAS
    • SPSS
    • STATA
    • Python
    • R
  • We will use R for the following reasons:
    1. it is free and open source software with extensive documentation and tutorials available;
    2. it has well established libraries for statistical modeling with a wide functionality;
    3. the entry barrier to using the R language in terms of computer science training is very low; and
    4. there are free interactive, introductory lessons from DataCamp which will be used for homework assignments for additional practice outside of class.

Required software sources

RStudio