?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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of luan_sheng > Sent: Tuesday, May 31, 2005 3:22 PM > To: [email protected] > 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 > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
