[R] faster vector subtraction??

Giovanni Petris GPetris at uark.edu
Wed Jan 16 23:38:32 CET 2002


I would start by looking at 
> outer(x,y,'-')

Giovanni

-- 

 __________________________________________________
[                                                  ]
[ Giovanni Petris                 GPetris at uark.edu ]
[ Department of Mathematical Sciences              ]
[ University of Arkansas - Fayetteville, AR 72701  ]
[ Ph: (501) 575-6324, 575-8630 (fax)               ]
[ http://definetti.uark.edu/~gpetris/              ]
[__________________________________________________]

> From: =?iso-8859-1?Q?S=F8ren_Merser?= <merser at image.dk>
> Date: Wed, 16 Jan 2002 21:20:18 +0100
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
> Sender: owner-r-help at stat.math.ethz.ch
> Precedence: SfS-bulk
> Content-Type: text/plain;
> 	charset="iso-8859-1"
> Content-Length: 509
> 
> hi
> is there a faster way to do this?
> 
> i <- 1
> for(x in vector1)
>      for(y in vector2) {
>          m[[i]] <- (x - y)
>          i <- i + 1
>       }
> 
> regards soren
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list