Dear R-users

 

I am using RPART package to get regression trees.  However having trouble getting the text function to put the full splitting rule number on the plot, instead to puts it in scientific notation.  When a covariate has 1e4 or greater number of digits then the splitting rule number displayed on the plot is in scientific notation.  But print.rpart displays the splitting rules in full.  I have tried using digits option in text function but this only alters digits of the mean displayed at terminal nodes.  How do I get the full splitting rule number displayed on the tree plot?

Below is an example. 

 

library(rpart)

temp <- as.data.frame(cbind(kyphosis, Start2=kyphosis$Start))

 

temp$Start2 <- temp$Start2+10000

 

fit1 <- rpart(Age~ Kyphosis +Number + Start2, data=temp)

plot(fit1)

text(fit1, use.n=TRUE, digits=5)

Thanks


 Dr Rebecca O'Leary, PhD

 Biostatistician
 Senior Research Officer
 UWA Centre for Child Health Research
 Telethon Institute for Child Health Research, 100 Roberts Rd, Subiaco
 Perth WA 6008 Australia
 Email: roleary@ichr.uwa.edu.au
 Tel: +61-8-9489 7745
 Fax: +61-8-9489 7700


#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by MailMarshal
#####################################################################################

	[[alternative HTML version deleted]]


