Skip to content
Back to formatted view

Raw Message

Message-ID: <200505312244.j4VMhwcX022091@meitner.gene.com>
Date: 2005-05-31T22:43:58Z
From: Bert Gunter
Subject: why is it numeric(0)?
In-Reply-To: <200505312222.j4VMMG3D027976@hypatia.math.ethz.ch>

?numeric

Hint: Type numeric(0) and numeric(1) at the prompt and see what you get.
What is the sum of anything and a zero length vector?

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box
 
 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of luan_sheng
> Sent: Tuesday, May 31, 2005 3:22 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] FW: why is it numeric(0)?
> 
> 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? 
> 
> 
> __________________________________________________
> 
> QE;"Cb7QGSJOd#-VP9z5ZR;>xN^@,;xSJ<~I'HE3,4sSJOd
> 
> ______________________________________________
> 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
>