I am trying to subset a data.table ( from the package data.table ) in R (not a data.frame). I have a 4 digit year as a key. I would like to subset by taking a series of years. For example, I want to pull all the records that are from 1999, 2000, 2001.
I have tried passing in my DT[J(year)]
binary search syntax the following:
1999,2000,2001
c(1999,2000,2001)
1999, 2000, 2001
but none of these seem to work. Anyone know how to do a subset where the years you want to select are not just 1 but multiple years?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…