Duncan Murdoch wrote:
Just declaring it there is the only reasonable way, i.e.
test<-function(foo) {
subtest <- function() {
foo <<- foo+1
}
subtest()
return(foo)
}
The reason you can't somehow assign it within an existing test is that
subtest is a different closure every time.
On 11/11/2009 10:19 AM, Stefan Zeugner wrote:
Duncan Murdoch wrote:
Just declaring it there is the only reasonable way, i.e.
test<-function(foo) {
subtest <- function() {
foo <<- foo+1
}
subtest()
return(foo)
}
The reason you can't somehow assign it within an existing test is that
On 11/10/2009 11:14 AM, Stefan Zeugner wrote:
Hello,
After hours of googling I could not resolve the following (although it
seems simple):
I would like to put subfunctions in a separate .R file that is then
called with source() from inside several "main" functions. A crude
example would be a
Hello,
After hours of googling I could not resolve the following (although it
seems simple):
I would like to put subfunctions in a separate .R file that is then
called with source() from inside several "main" functions. A crude
example would be as follows:
file subtest.R **
sub
4 matches
Mail list logo