Typically though not always the output of a function is a list. For
this problem I first try "attributes", as illustrated in the following
example:
> tstFun <- function()
{
list(a = 1, b = 2)
}
> attributes(tstFun())
$names:
[1] "a" "b"
> tstFun()$a
[1] 1
> tstFun()[["a"]]
[1] 1
#########################
If this does not work, the problem is harder. If this fails in your
problem, please submit a more specific question.
Hope this helps,
Spencer Graves
JedSimons@aol.com wrote:
I remember reading about a function which extracts just one component of
the output of another function.
eg if the output was from fitting a model, each word (or so) of the
output could be accessed an subscript index.
I cannot remember the name of the function, or find it anywhere. Does
anyone happen to know ? (I'm using Splus 6 under windows.)
Jed Simons
Institute of Biotechnology
UK
|