Stat 579: More on Array and Matrix
Operations
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
,
1/12
Example: Color Quantization of Images
Objective: Represent an Image in terms of a
Stat 579: Introduction and Preliminaries
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
August 25, 2011
,
1/10
What is R?
Statistical software fullling similar functions as SAS, SPSS
Stat 579: Graphical Displays
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
,
1/19
Plots and Graphical Parameters
We start with a simple example.
illit <- state.x77[ ,3]
murder <- st
Stat 579: Writing Functions
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
,
1/13
Writing Functions
One of the most important features of R is the ability to
write and modify functio
Stat 579: List Objects
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
,
1/10
Example: Eigenvalues of a matrix
mm <- matrix(rpois(9), ncol = 3)
emm <- eigen(mm)
mode(emm)
This functio
Stat 579: Grouping, Loops and Conditional
Execution
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
,
1/16
Grouped expressions
R is an expression language in the sense that its only
c
Stat 579: Objects in R Vectors
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
,
1/23
Logical Vectors I
R allows manipulation of logical quantities. The elements
of a logical vector c
Stat 579: More Preliminaries, Reading from
Files
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
September 1, 2011
,
1/10
Some more introductory examples I
Let us make a vector contai
Stat 579: Elementary Operations and
Functions
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
,
1/10
Vectors and assignment - I
R operates on named data structures. The simplest such
Stat 579: Array and Matrix Operations
Ranjan Maitra
2220 Snedecor Hall
Department of Statistics
Iowa State University.
Phone: 515-294-7757
maitra@iastate.edu
,
1/22
Some Notes on Objects: Attributes - I
R operates on entities technically known as objects.