Re: [R] rpart plot question

2005-08-11 Thread John Field
Petr Pikal wrote: Dear all I am quite confused by rpart plotting. Here is example. set.seed(1) y <- (c(rnorm(10), rnorm(10)+2, rnorm(10)+5)) x <- c(rep(c(1,2,5), c(10,10,10)) fit <- rpart(x~y)## NB should be y~x plot(fit) text(fit) Text on first split says x < 3.5 and on the secon

[R] rpart plot question

2005-08-09 Thread Petr Pikal
Dear all I am quite confused by rpart plotting. Here is example. set.seed(1) y <- (c(rnorm(10), rnorm(10)+2, rnorm(10)+5)) x <- c(rep(c(1,2,5), c(10,10,10)) fit <- rpart(x~y) plot(fit) text(fit) Text on first split says x < 3.5 and on the second split x < 1.5 what I understand: If x < 3.5 so y