First question: Yes
Second question: z in func.int2 is z in myfunc (z=y^3).

You can easily test:

f0<-function(){
  z<-1
  f1<-function()print("f1")
  f2<-function(z){f1();print(z)}
  f2(z)
}
z<-0
f0()


R language definition may be helpful

http://cran.r-project.org/doc/manuals/R-lang.html#Scope-of-variables

On 1/26/07, domenico pestalozzi <[EMAIL PROTECTED]> wrote:
> 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]]
>
> ______________________________________________
> [email protected] 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.
>

______________________________________________
[email protected] 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