Re: [R] vectorisation suggestion

2005-06-20 Thread Wiener, Matthew
alf Of Federico Calboli Sent: Monday, June 20, 2005 4:16 PM To: r-help Subject: [R] vectorisation suggestion Hi All, I am counting the number of occurrences of the terms listed in one vector in another vector. My code runs: for( i in 1:length(vector3)){ vector3[i] = sum(1*is.element(vector

Re: [R] vectorisation suggestion

2005-06-20 Thread james . holtman
ROTECTED]To: r-help c.uk>cc: Sent by: Subject: [R] vec

Re: [R] vectorisation suggestion

2005-06-20 Thread Federico Calboli
On 20 Jun 2005, at 21:24, Erin Hodgess wrote: > Hello, Federico! > > I'm a bit confused about your question, please: > > What sorts of things are in Vector1, please? numbers (as in "numeric") that code individuals > > Why are you counting NAs in Vector3, please? I am counting how many times th

[R] vectorisation suggestion

2005-06-20 Thread Federico Calboli
Hi All, I am counting the number of occurrences of the terms listed in one vector in another vector. My code runs: for( i in 1:length(vector3)){ vector3[i] = sum(1*is.element(vector2, vector1[i])) } where vector1 = vector containing the terms whose occurrences I want to count vector2 =