Re: [R] Finding elements in a character vector

2011-04-08 Thread Downey, Patrick
Perfect. Thank you. -Mitch -Original Message- From: Phil Spector [mailto:spec...@stat.berkeley.edu] Sent: Friday, April 08, 2011 8:03 PM To: Downey, Patrick Cc: r-help@r-project.org Subject: Re: [R] Finding elements in a character vector match(list.a,list.b

Re: [R] Finding elements in a character vector

2011-04-08 Thread Phil Spector
match(list.a,list.b) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

[R] Finding elements in a character vector

2011-04-08 Thread Downey, Patrick
Hello, I have two character vectors: list.a and list.b. Every element of list.a appears somewhere in list.b. Not all elements of list.b are in list.a, and some elements of list.b appear multiple times in list.a. I want to create a new vector (index) of the same length as list.a where the nth eleme