Introduction to R and RStudio

UBC Library Research Commons


http://ubc-library-rc.github.io/data-analysis-r/

https://libcal.library.ubc.ca/appointments/research_commons/

The Vancouver Campus is located on the traditional, ancestral, and unceded territory of the xʷməθkʷəy̓əm (Musqueam) people.
Map: https://native-land.ca/

Participating online - Reactions

Zoom toolbar

Reactions menu

Participating online - Annotate

View options

Annotate menu

Learning objectives


  1. Become familiar with R and R studio environment
  2. Learn some basic R concepts and functions
  3. Learn to explore and manipulate data in R

Outline

0:10 The R Studio environment
0:15 Working directory and basic operators
0:20 Data type and data structure
0:55 Break
1:00 Packages
1:10 Importing and exporting data
1:20 Data manipulation

Pre workshop setup


  1. Install R
  2. Install R Studio

R is a programming language developed by statisticians for data analysis.

  • free and open source
  • interactive data analysis - R Console
  • script - R Editor

R Studio makes it easier to work with R

Open RStudio

  • text editor
  • command history
  • environment details
  • file browser
  • ...

R Markdown

https://rmarkdown.rstudio.com

  • narratives
  • code chunks
  • results
  • outputs

Download and Open the R Markdown file