[R] select values from list using Date as index
- by Pieter
Suppose I have a list as follows
bar=c()
bar["1997-10-14"]=1
bar["2001-10-14"]=2
bar["2007-10-14"]=1
How can I select from this list all values for which the index is within a specific date range? So, if I look for all values between "1995-01-01" and "2000-06-01", I should get 1. And similarly for the period "2001-09-01" and "2007-11-04", I should get 2 an 1.