Try:
if (identical(test, numeric(0))) ...
On 7/23/07, Alexander.Herr at csiro.au <Alexander.Herr at csiro.au>
wrote:> Hi List,
>
> I am trying to capture the numeric(0) with an if statement,
> unsucessfully:
>
> test<-numeric(0)
>
> if(test == numeric(0)) print("test is", test)
>
> I get: Error in if (test == numeric(0)) print("test is", test) :
> argument is of length zero
>
> How can I capture the numeric(0) condition?
>
> Any enlightment appreciated
> Cheers
> Herry
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>