Displaying 3 results from an estimated 3 matches for "fnction".
Did you mean:
function
2012 Feb 04
1
'deparse(substitute'))' then 'assign' in a S4 methods
Hi the list,
I am writing a function in which I need to affect a variable on a higher
level. My fnction could be:
++++++++++++++++++
fooBis <- function(x){
nameObject <- deparse(substitute(x))
print(nameObject)
assign(nameObject,4,envir=parent.frame())
}
> fooBis(e)
[1] "e"
> e
[1] 4
-----------------
(to simplify, this fnction can affect only the number 4. B...
2000 Aug 04
2
running non-base functions
Having loaded R for windows, I cannot run fnctions that aren't in the
base folder.
Typing searchpaths() tells me that only the base folder is in the search
path. How can the path be modified to include other folders?
Thanks,
Ely
rabin at brandeis.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mai...
2006 Jun 20
1
list of interdependent functions
...is given below.
Thanks a lot
Thomas
##======================================================
## An example
##======================================================
## a small list of functions
eq <- list(
f1 = function(x, K) K - x,
f2 = function(x, r, K) r * x * f1(x, K)
)
## a solver fnction which calls them
solverB <- function(eq) {
eq <- putInEnv(eq, environment()) # that's the trick
f1(3,4) + f2(1,2,3)
}
## and the final call (e.g. from the command line)
solverB(eq)
##======================================================
## One possible solution. Is there a better...