Your first example is all one statement. Within that statement you are defining
elements of a list. Unfortunately you are defining some of those elements in
terms of others, but they don't exist until the statement has completed. If you
break the statement up into an initial list formation state
I suspect that Dr. Jim is conflating the behavior of R w.r.t.
arguments in a function call (where assignment to one argument can be
"seen" by another argument) with the behavior of naming items in a
list expression.
--
David.
On Oct 20, 2010, at 11:01 AM, jim holtman wrote:
I do not see
I do not see that it has been "created" yet. You my have defined it
earlier in the 'list' expression, but as an object it is not available
yet. You might have to do something like uwing 'within'
> x <- list()
> x <- within(x, {
+ a = 1:10
+ b = 11:20
+ c = a + b
+ d = a * b})
> x
$d
[1] 11 24
I can not understand why this fails
>
> faicoutput2 <- list(stuff21 = as.numeric(faicout$coefficients[2]),
+ stuff31=as.numeric(faicout$coefficients[3]),
+ stuff41=as.numeric(faicout$coefficients[4]),
+ stuff32=(stuff21-stuff31),
+
4 matches
Mail list logo