[R] capture numeric(0) with if statement

Richard M. Heiberger rmh at temple.edu
Tue Jul 24 03:51:33 CEST 2007


> test <- numeric(0)
> length(test)
[1] 0
> if (length(test) == 0) print("length=0")
[1] "length=0"



More information about the R-help mailing list