The "abalone.data" code is ;
aba <- read.csv("abalone.data",header=T,as.is=T)
grps <- list()
for (gen in c("M","F")) grps[[gen]] <- which(aba==gen)
abam <- aba[grps$M,]
abaf <- aba[grps$F,]
plot(abam$Length,abam$Diameter)
plot(abaf$Length,abaf$Diameter,pch="x",new=FALSE)
Should be modified to ;
aba <- read.csv("abalone.data",header=T,as.is=T)
grps <- list()
for (gen in c("M","F")) grps[[gen]] <- which(aba[,1]==gen)
abam <- aba[grps$M,]
abaf <- aba[grps$F,]
plot(abam$Length,abam$Diameter)
plot(abaf$Length,abaf$Diameter,pch="x",new=FALSE)
The "abalone.data" dataset :
'Learning & Reasoning > R ' 카테고리의 다른 글
6.3.2 Extended Example: Extracting a Subtable "The Art of R Programming" (0) | 2013.02.15 |
---|---|
alternative implement "The art of R programming" - 3.4.2 Extended Example (0) | 2013.02.13 |
Erratum in "The art of R programming" (0) | 2013.02.08 |
vector라 불리는 R 자료구조 (0) | 2013.02.06 |
AdaBoost (0) | 2013.02.01 |