[R] FW: why is it numeric(0)?

luan_sheng luan_sheng at yahoo.com.cn
Wed Jun 1 00:22:06 CEST 2005


hello,everyone. I have one question:

example 1
> x=numeric(0)
> y=5
> print(x+y)
numeric(0)
 
example 2
> x=numeric(1)
> y=5
> print(x+y)
[1] 5

why the print(x+y)  is numeric(0) at the first example, but the result is 0
at the second example? 


__________________________________________________

ÑÅ»¢Ãâ·ÑGÓÊÏä£­ÖÐ¹úµÚÒ»¾øÎÞÀ¬»øÓÊ¼þÉ§ÈÅ³¬´óÓÊÏä




More information about the R-help mailing list