Skip to content
Prev 325567 / 398503 Next

Help understanding environments

Since you set
   combined <- NULL
at the top of the function
   exists("combined")
will always return TRUE.  If you initialize 'combined' to NULL,
use is.null(combined) to see if it is still in its virgin state.  If you
don't initialize it to anything then use exists("combined").
In this example you are combining the results with c(), which
essentially ignores NULL arguments so you don't need the
if-else at all if you initialize 'combined' to NULL. 

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com