s-news
[Top] [All Lists]

Re: simple vector question

To: "Eric yang" <yang_eric9@yahoo.com>, <s-news@wubios.wustl.edu>
Subject: Re: simple vector question
From: "Chalvatzis, Dimitrios (Energy Wholesale)" <Dimitrios.Chalvatzis@eon-uk.com>
Date: Wed, 12 Oct 2005 16:35:01 +0100
Thread-index: AcXPQimbn4Z19JrNSCuu3aFbtfZEJQAAFceQ
Thread-topic: [S] simple vector question

outer(a,b,"+")

 

Dimitrios Chalvatzis
Risk Analyst
Energy Wholesale/Risk Policies & Methods
T +44 (0)24 7642 5429
F +44 (0)24 7642 5479
Dimitrios.Chalvatzis@eon-uk.com

 

-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Eric yang
Sent:
Wednesday, October 12, 2005 4:32 PM
To: s-news@wubios.wustl.edu
Subject: [S] simple vector question

 

 

Dear all,

 

I want to add two vectors of unequal length such that the vectors in one are added to each of the values in the other, e.g.

 

a<- c(22, 40, 60, 81)

b <- c(3, 5, 9)

 

c<- c(a[1] +b, a[2]+b, a[3]+b, a[4]+b) 

 

Is there a shorthanded way to do

c(a[1] +b, a[2]+b, a[3]+b, a[4]+b)  ?

 

Thanks in advance.

 

Eric


Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

___________________________ Disclaimer Notice ____________________
This message and any attachments are confidential and should only
be read by those to whom they are addressed. If you are not the
intended recipient, please contact us, delete the message from your
computer and destroy any copies. Any distribution or copying without
our prior permission is prohibited.

Internet communications are not always secure and therefore the
E.ON Group does not accept legal responsibility for this message.
The recipient is responsible for verifying its authenticity before
acting on the contents. Any views or opinions presented are solely
those of the author and do not necessarily
represent those of the E.ON Group.

E.ON UK plc, Westwood Way, Westwood Business Park,
Coventry, CV4 8LG.
Registered in England & Wales No. 2366970

E.ON UK Trading Ltd, Westwood Way, Westwood Business Park,
Coventry, CV4 8LG
Registered in England & Wales No. 4178314

E.ON UK Trading Ltd is regulated by the Financial Services
Authority to carry out investment activities.

Telephone +44 (0) 2476 42 4000
Fax +44 (0) 2476 42 5432
<Prev in Thread] Current Thread [Next in Thread>