oliveOils2_4perPage - Outline Classication in R 1...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Classifcation in R Data Mining Prof. Dawn Woodard School of ORIE Cornell University 1 Outline 1 Announcements 2 R Programming 2 Announcements ... 4 R / S-PLUS Classes Vector, array, data.frame, list. Test with e.g. is.vector( myObject ) , is.data.frame(myObject) Created in different ways Dereferenced in different ways Each can have elements that are of type numeric, character, factor, or logical. numeric means real-valued / integer-valued character means character / string factor means categorical logical means TRUE / FALSE 6
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
R / S-PLUS Vectors Vector objects can be created by: > a <- c(7, 3, 7) > b <- (1:5) > c <- rep(0, 10) > d <- c(“Monday”, “Tuesday”) Vectors can be of type numeric, character, factor, or logical: > is.numeric(a) [1] T > is.factor(a) [1] F > is.character(d) [1] T 7 R / S-PLUS Vectors To ±nd out the number of elements in a vector, call length : > a <- rep(0, 7) > length(a) [1] 7 > a <- c(“Monday”, “Tuesday”) > length(a) [1] 2 The “[1]” here just indicates the ±rst line of the displayed results.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

oliveOils2_4perPage - Outline Classication in R 1...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online