[R] ipred and lda
Stefan Böhringer
commercial at s-boehringer.de
Fri Jan 9 16:46:23 CET 2004
Dear all,
can anybody help me with the program below? The function predict.lda
seems to be defined but cannot be used by errortest.
The R version is 1.7.1
Thanks in advance,
Stefan
----------------
library("MASS");
library("ipred");
data(iris3);
tr <- sample(1:50, 25);
train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3]);
test <- rbind(iris3[-tr,,1], iris3[-tr,,2], iris3[-tr,,3]);
cl <- factor(c(rep("s",25), rep("c",25), rep("v",25)));
z <- lda(train, cl);
predict(z, test)$class;
data.frame(class=cl, train);
flowers <- data.frame(class=cl, train);
errorest(class ~ ., data=flowers, model=lda, estimator="cv",
predict=predict.lda);
Error-Message is :
Error: Object "predict.lda" not found
More information about the R-help
mailing list