Skip to content

why is it numeric(0)?

1 message · luan_sheng

#
yea, I have read the help. But some one tell me that i f you want use a
vector that you don't know it's length, you should use xx=numric(0) , is it
not right? If it isn't right, how can I do?
thanks

-----Original Message-----
From: Douglas Grove [mailto:dgrove at fhcrc.org] 
Sent: Wednesday, June 01, 2005 6:27 AM
To: luan_sheng
Subject: Re: [R] FW: why is it numeric(0)?

Have you read the help page for numeric (?numeric) to understand what it
does?  You should really look at help pages prior to posting.

numeric(x) returns a numeric vector of length x, with all entries
initialized to zero

so numeric(1) returns 0,
numeric(2) returns c(0,0)
etc.

numeric(0) returns a numeric vector of *length 0*, so when you add anything
to it you get the same result (it's basically a numeric NULL)
On Wed, 1 Jun 2005, luan_sheng wrote:

            
__________________________________________________

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