Skip to content

List of Lists

3 messages · glenn, David Winsemius, Hadley Wickham

#
See if one of %in% or match gets your further.

 > 1:10 %in% c(1,3,5,9)
  [1]  TRUE FALSE  TRUE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
 > match(c(1,3,5,9), 1:10)
[1] 1 3 5 9
 > match(c(1,3,5,9), 10:1)
[1] 10  8  6  2

date03 as offered was not a list, but a vector.

date04 <- date02[which(date02$date %in% date3), ]  # might work,  
nothing to test it on

If you only want the column of matching dates and not all the rows  
that have matching dates then this might work:
date04 <- date02[which(date02$date %in% date3), "date" ]

 From you incorrect use of the term "list" (in the context of R,  
anyway), I am guessing that you don't really want lists but rather  
subsets of data.frames. Vector and list are not interchangeable terms  
in these parts.
#
On Wed, Jan 14, 2009 at 1:53 PM, glenn <g1enn.roberts at btinternet.com> wrote:
Have a look at ?split.

Hadley