[R] To define a function which includes two functions as arguments such as "plot" and "text"

Yashwanth M.R yashwanth at predictiveanalytics.in
Fri Feb 24 12:22:38 CET 2012


Here is the two functions which I have used during my practice. 

*plot(Telco.rpart.METHOD.CLASS,compress=FALSE,uniform=TRUE)

text(Telco.rpart.METHOD.CLASS,use.n = TRUE, cex = .75))*

"Telco.rpart.METHOD.CLASS" is my "rpart" object of the method "class".

If I run this,

*Telco.Rpart.PLOT.TEXT <-
c(plot(Telco.rpart.METHOD.CLASS,compress=FALSE,uniform=TRUE),
				                     text(Telco.rpart.METHOD.CLASS,use.n = TRUE, cex =
.75))
*

http://r.789695.n4.nabble.com/file/n4416881/Rpart.gif 

the output is getting generated as shown in the figure. But if I solely run 
the same command "Telco.Rpart.PLOT.TEXT" right after the above, the output
is as below,

/$x
 [1]  4.035156  1.000000  7.070312  3.015625  2.000000  4.031250
 [7]  3.000000  5.062500  4.000000  6.125000  5.000000  7.250000
[13]  6.500000  6.000000  7.000000  8.000000 11.125000 10.250000
[19]  9.500000  9.000000 10.000000 11.000000 12.000000

$y
 [1] 1.125 1.000 1.000 0.875 0.750 0.750 0.625 0.625 0.500 0.500 0.375
[12] 0.375 0.250 0.125 0.125 0.250 0.875 0.750 0.625 0.500 0.500 0.625
[23] 0.750
/


Please help me in getting the output which is there is the Image..

Regards,
Yashwanth M,R

--
View this message in context: http://r.789695.n4.nabble.com/To-define-a-function-which-includes-two-functions-as-arguments-such-as-plot-and-text-tp4416881p4416881.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list