R-studio tutorial

Krung Sinapiromsaran
October 2014

Outline

  • R programming language
  • R IDE
  • R commands
  • R Studio
    • Console Pane
    • Viewer Pane
    • Extra viewing Pane
    • Source Pane

R programming language

R icon is a computing environment, similar to matlab

  • R is a high-level language based on scheme and S.
  • R communicates to a user via
  • console to execute one command at a time
  • script to execute selection of R statements
  • interactive to execute GUI commands

R history

  • S language from Bell labs and became commercial as S-plus (http://www.insightful.com/) in 1988
  • R is a combination of S and Scheme from Ross Ihaka and Robert Gentleman

R Studio plot with options

plot(sin,-3*pi,3*pi,type="l",col="red",lwd=5)
title("Plot sin from -3 pi to 3 pi")

plot of chunk unnamed-chunk-25

R Studio plot

y <- c(3.1, 4.2, 2.1, 3.2, 4.2, 5.1)
plot(y, type="b", col="blue", lwd=5)
title("Plot y from data")

plot of chunk unnamed-chunk-26

Summary

  • A user learns how to write R statements.
  • There are a lot of R IDEs available such as R Studio.
  • R has many primitive data types and a user can generate combination of them easily
  • R Studio composes of four extra panes
  • Console pane
  • Viewer pane
  • Extra viewing pange
  • Source pane