[R] comparing a list and vector and returnig the listname

2008-09-10 Thread Rajasekaramya
hi, I have list of length 5453 and vector of length 14318.I need to compare the vector with the list and return the list name if matched.I am thinking of using an lapply but how to retrive the listname is wat i am puzzled abt. kindly let me know how to go abt it. Ramya -- View this message in

Re: [R] comparing a list and vector and returnig the listname

2008-09-10 Thread Henrique Dallazuanna
If I understand, try this: names(l[l %in% v]) where l is your list and v is your vector. On Wed, Sep 10, 2008 at 1:38 PM, Rajasekaramya [EMAIL PROTECTED]wrote: hi, I have list of length 5453 and vector of length 14318.I need to compare the vector with the list and return the list name if

Re: [R] comparing a list and vector and returnig the listname

2008-09-10 Thread Adam D. I. Kramer
Maybe, for vector v and list l match(v,names(l)) ? --Adam On Wed, 10 Sep 2008, Rajasekaramya wrote: hi, I have list of length 5453 and vector of length 14318.I need to compare the vector with the list and return the list name if matched.I am thinking of using an lapply but how to retrive