Introduction to R
•   http://cran.r-project.org/
•   The Comprehensive R Archive Network
•   The Base System
•   The idea of Packages
•   Open source Implementation of S
•   Commercial implementation is S Plus

                -Sujoy Bhattacharya
• Default Prompt is ‘>’
• setwd("C:/Documents and
  Settings/USER/My Documents")
• getwd()
• ?(plot)
• R is case sensitive
• Objects in R: variables, arrays of numbers,
  character strings, functions .
• function c()
• assignment operator (‘<-’)
• Create an object z such that: x=1 to 20,
  y= 30 to 35, z= concatenation of x and y
• common arithmetic functions: log, exp, sin,
  cos, tan, sqrt
• range()
• mean(y)=sum(y)/ length(y)
• sort(object): elements are arranged in
  increasing order
•   seq(from=5, to=50)
•   seq(-4, 4, by=.1)
•   z<- rep(x, times=4)
•   rep(x, each=4)
Logical Vectors
•   values :TRUE, FALSE, and NA
•   <, <=, >, >=, ==(equality) != ( inequality)
•   z <- x > 20
•   z1 & z2 (intersection)
•   z1 | z2 (union)
•   !z negation of z
•   NA and NaN
•   Do 0/0 and z<- c(2,5,NA)
•   Operations on NA are NA
•   Do z<- c(1:100,NA)
•   t<- 100*z
•   Arrays: dim(z) <- c(3,2,2)
•   z[1,1,1]
•   While entering data match length
•   z[1,1,]
•   z <- array(1:20, dim=c(4,5))
•   Z <- array(data_vector, dim_vector)
•   object <- array(data_vector, dim_vector)
•   dd <- array(data=c(1:125),c(5,5,5))
•   cbind() and rbind()
•   z<- cbind(c(1:10),c(1:5))
•   transpose of an array: t(z)
•   Matrix product : x %*% y
• x<- array(data=c(1:6),c(2,3))
• Matrix inversion :solve(z)
• x<- cbind(1, y, z): y,z must have equal
  rows.
•   read.csv(file.choose(), header=T)
•   reg1 <- lm(y ~ x1 + x2, data = nse)
•   plot(object)
•   residuals(object)
•   plot(x, y)
R communities
• www.r-project.org
• www.r-forge.r-project.org
• www.rstudio.com

More Related Content

PPT
Arrays
PPTX
Mat lab lecture part 1
PPTX
PPTX
Edu presentation1
PDF
The Ring programming language version 1.3 book - Part 32 of 88
DOC
Seg code
PPTX
Master's Thesis
PDF
Corner Stitching in Swift @ Base Labs - Krakow
Arrays
Mat lab lecture part 1
Edu presentation1
The Ring programming language version 1.3 book - Part 32 of 88
Seg code
Master's Thesis
Corner Stitching in Swift @ Base Labs - Krakow

What's hot (19)

PDF
The Ring programming language version 1.7 book - Part 28 of 196
PDF
The Ring programming language version 1.6 book - Part 44 of 189
PDF
Brief intro to clojure
PDF
ECMAScript 6 major changes
PDF
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
DOCX
Computer Graphics Lab File C Programs
PDF
Numpy python cheat_sheet
PPTX
Software Design Thinking
DOCX
Numerical Method Assignment
PDF
Single page-integral-table
PDF
Single page-integral-table
DOC
Computer graphics
DOCX
CLUSTERGRAM
PPTX
Visualization team presentation
PDF
Integral table
PDF
Integral table
PDF
Tabla integrales
PPTX
Python programing
PDF
Integral table
The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.6 book - Part 44 of 189
Brief intro to clojure
ECMAScript 6 major changes
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
Computer Graphics Lab File C Programs
Numpy python cheat_sheet
Software Design Thinking
Numerical Method Assignment
Single page-integral-table
Single page-integral-table
Computer graphics
CLUSTERGRAM
Visualization team presentation
Integral table
Integral table
Tabla integrales
Python programing
Integral table
Ad

Viewers also liked (12)

PDF
Comprehensive R Arichive Network (CRAN)
PPT
What's New in AutoCAD Electrical 2010
PDF
E nodeb commissioning guide(v100r005c00 04)(pdf)-en
PDF
DWDM Presentation
PDF
140556299 huawei-node b-data-configuration
PPT
The Huawei Node B Evolution
PPTX
HOME WIRING(domestic wiring)
PPTX
Presentation about Fiber Optics
PPT
optical fibre ppt for download visit http://nowcracktheworld.blogspot.in/
PPT
Electrical Wiring Practices and Diagrams
PDF
Introduction to Building Wireframes (with OmniGraffle)
PPTX
OTN for Beginners
Comprehensive R Arichive Network (CRAN)
What's New in AutoCAD Electrical 2010
E nodeb commissioning guide(v100r005c00 04)(pdf)-en
DWDM Presentation
140556299 huawei-node b-data-configuration
The Huawei Node B Evolution
HOME WIRING(domestic wiring)
Presentation about Fiber Optics
optical fibre ppt for download visit http://nowcracktheworld.blogspot.in/
Electrical Wiring Practices and Diagrams
Introduction to Building Wireframes (with OmniGraffle)
OTN for Beginners
Ad

Similar to Introduction to R (20)

PDF
Learning notes of r for python programmer (Temp1)
PPTX
Introduction to R.pptx
PDF
Big datacourse
PDF
An overview of Python 2.7
PDF
A tour of Python
PDF
R language, an introduction
PPTX
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
PPTX
Introduction to matlab
PPTX
Ggplot2 v3
PDF
Data Analysis and Programming in R
PPTX
8150.graphs
PDF
On Beyond (PostgreSQL) Data Types
PDF
PDF
Rug hogan-10-03-2012
PPT
Python 101 language features and functional programming
PPTX
Data analysis with R
PPT
PDF
PDF
Tutorialmatlab kurniawan.s
PDF
Tutorial matlab
Learning notes of r for python programmer (Temp1)
Introduction to R.pptx
Big datacourse
An overview of Python 2.7
A tour of Python
R language, an introduction
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Introduction to matlab
Ggplot2 v3
Data Analysis and Programming in R
8150.graphs
On Beyond (PostgreSQL) Data Types
Rug hogan-10-03-2012
Python 101 language features and functional programming
Data analysis with R
Tutorialmatlab kurniawan.s
Tutorial matlab

Recently uploaded (20)

PPTX
Board-Reporting-Package-by-Umbrex-5-23-23.pptx
DOCX
Center Enamel Powering Innovation and Resilience in the Italian Chemical Indu...
PDF
NISM Series V-A MFD Workbook v December 2024.khhhjtgvwevoypdnew one must use ...
DOCX
Hand book of Entrepreneurship 4 Chapters.docx
PPTX
IITM - FINAL Option - 01 - 12.08.25.pptx
PDF
Keppel_Proposed Divestment of M1 Limited
PDF
Ron Thomas - Top Influential Business Leaders Shaping the Modern Industry – 2025
PDF
Tortilla Mexican Grill 发射点犯得上发射点发生发射点犯得上发生
PDF
ICv2 White Paper - Gen Con Trade Day 2025
PDF
TyAnn Osborn: A Visionary Leader Shaping Corporate Workforce Dynamics
DOCX
Handbook of Entrepreneurship- Chapter 5: Identifying business opportunity.docx
PDF
Kishore Vora - Best CFO in India to watch in 2025.pdf
PDF
#1 Safe and Secure Verified Cash App Accounts for Purchase.pdf
PDF
ANALYZING THE OPPORTUNITIES OF DIGITAL MARKETING IN BANGLADESH TO PROVIDE AN ...
PDF
Chapter 2 - AI chatbots and prompt engineering.pdf
PDF
Booking.com The Global AI Sentiment Report 2025
PDF
PMB 401-Identification-of-Potential-Biotechnological-Products.pdf
PDF
Nante Industrial Plug Factory: Engineering Quality for Modern Power Applications
PDF
NEW - FEES STRUCTURES (01-july-2024).pdf
PPTX
Slide gioi thieu VietinBank Quy 2 - 2025
Board-Reporting-Package-by-Umbrex-5-23-23.pptx
Center Enamel Powering Innovation and Resilience in the Italian Chemical Indu...
NISM Series V-A MFD Workbook v December 2024.khhhjtgvwevoypdnew one must use ...
Hand book of Entrepreneurship 4 Chapters.docx
IITM - FINAL Option - 01 - 12.08.25.pptx
Keppel_Proposed Divestment of M1 Limited
Ron Thomas - Top Influential Business Leaders Shaping the Modern Industry – 2025
Tortilla Mexican Grill 发射点犯得上发射点发生发射点犯得上发生
ICv2 White Paper - Gen Con Trade Day 2025
TyAnn Osborn: A Visionary Leader Shaping Corporate Workforce Dynamics
Handbook of Entrepreneurship- Chapter 5: Identifying business opportunity.docx
Kishore Vora - Best CFO in India to watch in 2025.pdf
#1 Safe and Secure Verified Cash App Accounts for Purchase.pdf
ANALYZING THE OPPORTUNITIES OF DIGITAL MARKETING IN BANGLADESH TO PROVIDE AN ...
Chapter 2 - AI chatbots and prompt engineering.pdf
Booking.com The Global AI Sentiment Report 2025
PMB 401-Identification-of-Potential-Biotechnological-Products.pdf
Nante Industrial Plug Factory: Engineering Quality for Modern Power Applications
NEW - FEES STRUCTURES (01-july-2024).pdf
Slide gioi thieu VietinBank Quy 2 - 2025

Introduction to R

  • 1. Introduction to R • http://cran.r-project.org/ • The Comprehensive R Archive Network • The Base System • The idea of Packages • Open source Implementation of S • Commercial implementation is S Plus -Sujoy Bhattacharya
  • 2. • Default Prompt is ‘>’ • setwd("C:/Documents and Settings/USER/My Documents") • getwd() • ?(plot) • R is case sensitive
  • 3. • Objects in R: variables, arrays of numbers, character strings, functions . • function c() • assignment operator (‘<-’) • Create an object z such that: x=1 to 20, y= 30 to 35, z= concatenation of x and y
  • 4. • common arithmetic functions: log, exp, sin, cos, tan, sqrt • range() • mean(y)=sum(y)/ length(y) • sort(object): elements are arranged in increasing order
  • 5. seq(from=5, to=50) • seq(-4, 4, by=.1) • z<- rep(x, times=4) • rep(x, each=4)
  • 6. Logical Vectors • values :TRUE, FALSE, and NA • <, <=, >, >=, ==(equality) != ( inequality) • z <- x > 20 • z1 & z2 (intersection) • z1 | z2 (union) • !z negation of z
  • 7. NA and NaN • Do 0/0 and z<- c(2,5,NA) • Operations on NA are NA • Do z<- c(1:100,NA) • t<- 100*z
  • 8. Arrays: dim(z) <- c(3,2,2) • z[1,1,1] • While entering data match length • z[1,1,] • z <- array(1:20, dim=c(4,5)) • Z <- array(data_vector, dim_vector)
  • 9. object <- array(data_vector, dim_vector) • dd <- array(data=c(1:125),c(5,5,5)) • cbind() and rbind() • z<- cbind(c(1:10),c(1:5)) • transpose of an array: t(z) • Matrix product : x %*% y
  • 10. • x<- array(data=c(1:6),c(2,3)) • Matrix inversion :solve(z) • x<- cbind(1, y, z): y,z must have equal rows.
  • 11. read.csv(file.choose(), header=T) • reg1 <- lm(y ~ x1 + x2, data = nse) • plot(object) • residuals(object) • plot(x, y)
  • 12. R communities • www.r-project.org • www.r-forge.r-project.org • www.rstudio.com