I am using tree() in some classification work, and have been trying to suppress the number of significant digits shown in the output plot. There is a "digits" parameter that can be used in text.tree(), but I can't seem to make it have any effect. Here is some example code to illustrate what I mean:

####################################################
#some fake data
   set.seed(123)
   f1 <- factor(rep(1:4, 50))
   m1 <- matrix(runif(800), nc=4)
   d1 <- data.frame(f1, m1)
#the test
   library(tree)
   mdl1 <- tree(f1 ~ ., data=d1)
#(messy) output
   plot(mdl1); text(mdl1, cex=.6)
   plot(mdl1); text(mdl1, cex=.6, digits=2) #no change to labelling
#help!
   ?text.tree
####################################################

Can anyone spot my error? Many thanks for any help.

Ian Robertson

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to