<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4611.1300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=156055923-31032001><FONT face="Comic Sans MS" color=#0000ff
size=4>Thats because you have a minus sign before the c. instead of x<-
-c(1,2,3..) use x<- c(1,2,3..)</FONT></SPAN></DIV>
<DIV><SPAN class=156055923-31032001><FONT face="Comic Sans MS" color=#0000ff
size=4></FONT></SPAN> </DIV>
<DIV><SPAN class=156055923-31032001><FONT face="Comic Sans MS" color=#0000ff
size=4>cheers</FONT></SPAN></DIV>
<DIV><SPAN class=156055923-31032001><FONT face="Comic Sans MS" color=#0000ff
size=4></FONT></SPAN> </DIV>
<DIV><SPAN class=156055923-31032001><FONT face="Comic Sans MS" color=#0000ff
size=4>dilip</FONT></SPAN></DIV>
<DIV class=OutlookMessageHeader><FONT face="Times New Roman"
size=2>-----Original Message-----<BR><B>From:</B> owner-r-help@stat.math.ethz.ch
[mailto:owner-r-help@stat.math.ethz.ch]<B>On Behalf Of</B> hzi<BR><B>Sent:</B>
Sunday, April 01, 2001 4:25 PM<BR><B>To:</B>
r-help@stat.math.ethz.ch<BR><B>Subject:</B> [R] Is this a bug with a simple
arithmetic operation with a vector object?<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hello-</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> While I was reading a tutorial
book for R (actually, for S-Plus:Brian S. Everitt. A Handbook of Statistical
Analysis using S-PLUS. Chapman & Hall, London, 1994) I tried to execute this
simple exercise:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> <FONT
face="Courier New">> x <- -c(1,2,3,4,5,6)</FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2> > X <-
-c(10,11,12,100,-5,-6)</FONT></DIV>
<DIV><FONT face="Courier New" size=2> >x+X</FONT></DIV>
<DIV><FONT face="Courier New" size=2> [1] -11, -13, -15, -104,
0, 0</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> As you can see, the added
vectors resulted in negative numbers ! (the answer should have been: <FONT
face="Courier New">[1] 11, 13, 15, 104, 0, 0</FONT><FONT
face=Arial>)</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2> Mind you, this is R 1.2.1 for
Windows, under WIndows ME, 64 Mb RAM, pIII 800 MHz. The same thing happens,
however, with the recently distributed "R 1.2.2 patched".</FONT></DIV>
<DIV><FONT face=Arial size=2> Clues, anyone?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> Thank you.</FONT></DIV>
<DIV><FONT face=Arial size=2> Best regards,</FONT></DIV>
<DIV><FONT face="Courier New" size=2> <FONT
face=Arial> </FONT></FONT></DIV>
<DIV><FONT face=Arial size=2> Henry</FONT></DIV>
<DIV><FONT face=Arial size=2> <A
href="mailto:hzi@uol.com.br">hzi@uol.com.br</A></FONT></DIV></BODY></HTML>