I create a vector through a procedure simplified as
for (i in intervals) aa <- c(aa,ww[i])
Unfortunately, SPlus disallows adding a number to a vector that does not
yet exist.
I could preceed this "for" line with
aa <- numeric()
so appending would work well.
However, it seems even this might be improved by something like
for (i in interval) aa <- c(front(aa),ww[i]
in the original statement above, for some concocted function "front"
(made-up) that will ignore the component aa when undefined [it is not
just "na" for which I might us is.na()].
Because I have programmed a great deal in unix shells and perl,
I frequently more easily program with the expectation that I can ignore
a variable when it is missing.
Is there a function like my concocted front(aa) that would ignore a
variable when missing, but use it when present?
Thank you,
Jim Burt
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|