Thanks a lot! longfun2 longfun3 work perfect for my very
untypical problem. As I have many local variables, usual functions
with parameters are very uncomfortable, but the code you gave me is
great!
Meinhard
On Oct 4, 2006, at 5:25 PM, Gabor Grothendieck wrote:
longfun could just pass
I thought of a few more possibilities.
If options 1, 2 and 3 correspond to longfun, longfun2 and longfun3
then:
4. We could arrange it so that the variables are stored outside of
longfun and then longfun, f1 and f2 reference them symmetrically.
a - b - d - 1
longfun4 - function() {
out -
Hello R users,
I have a very long function with parts of that looking like a list of
jobs. The first part of the function defines a lot of local
variables, which are used by the jobs. Now I extracted the job part
und putted them into an external file, used by source(, local=T),
which is
longfun could just pass a, b and d to each of the individual
functions and each of the individual functions could pass
out back as a return value.
f1 - f2 - function(a, b, d) a+b+d
longfun1 - function() {
a - b - d - 1
out - f1(a, b, d)
out - f2(a, b, d) + out
out
}
longfun1() # 6