<!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.&nbsp; instead of x&lt;- 
-c(1,2,3..) use x&lt;- c(1,2,3..)</FONT></SPAN></DIV>
<DIV><SPAN class=156055923-31032001><FONT face="Comic Sans MS" color=#0000ff 
size=4></FONT></SPAN>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 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 &amp; Hall, London, 1994) I tried to execute this 
simple exercise:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
face="Courier New">&gt; x &lt;- -c(1,2,3,4,5,6)</FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; &gt; X &lt;- 
-c(10,11,12,100,-5,-6)</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; &gt;x+X</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; [1] -11, -13, -15, -104, 
0, 0</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp; Clues, anyone?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; Thank you.</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; Best regards,</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp;&nbsp;<FONT 
face=Arial>&nbsp;&nbsp;</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; Henry</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; <A 
href="mailto:hzi@uol.com.br">hzi@uol.com.br</A></FONT></DIV></BODY></HTML>