[R] defining function into another function

From: domenico pestalozzi <statadat_at_gmail.com>
Date: Fri 26 Jan 2007 - 13:46:44 GMT


If I define my function that includes others "internal functions", how can I define the parameter's functions?
That is:

myfunc<-function(y){...............

func.int1<- function(x){ sum(x}}

func.int2<-function(z){funct.int1(z)^2} .............................

}

Is it possible to use func.int1 into func.into2? or R doesn't identify func.int1 into func.into2?

Another question:
If I do

 myfunc<-function(y){...............
 z<-y^3

func.int1<- function(x){ sum(x}}
func.int2<-function(z){z^2}
.............................

}

func.int2 is based on z, but now is z=y^3 or a generical object?

thanks

pestalozzi

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch 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. Received on Sat Jan 27 00:59:36 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 27 Jan 2007 - 05:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.