Displaying 1 result from an estimated 1 matches for "argsn".
Did you mean:
args
2007 Nov 05
1
Should numeric()/character() etc initialize with NA instead of 0 or ""?
...elves
and programming errors would be far less easy to overlook.
e.g.
x <- numeric(n) or
for( i in seq(along = x) )
{
try(x[i] <- function.which.might.crash( args[i] ))
}
or
x <- numeric(n)
x[condition1] <- foo(args1)
x[condition2] <- foo(args2)
...
x[conditionN] <- foo(argsN)
will produce x without any NAs even if function.which.might.crash() actually
did crash during the loop or
if there are indices for which none of conditions 1 to N were true and you
cannot distinguish between zeroes which
are real results and zeroes that remained unchanged since initialization of...