df <- structure(list(x = 1:10, time = c(0.5, 0.5, 1, 2, 3, 0.5, 0.5,
1, 2, 3)), .Names = c("x", "time"), row.names = c(NA, -10L), class = "data.frame")
df[df$time %in% c(0.5, 3), ]
## x time
## 1 1 0.5
## 2 2 0.5
## 5 5 3.0
## 6 6 0.5
## 7 7 0.5
## 10 10 3.0
df[df$time == c(0.5, 3), ]
## x time
## 1 1 0.5
## 7 7 0.5
## 10 10 3.0
%in%
和==
这里有什么区别?`%in%`和`==`之间的区别
请参阅R' – 2013-03-12 09:56:35
'中的'?'=='和'?'%你可能会对[视频编号#033]感兴趣(http://www.twotorials.com/) – 2013-03-12 13:24:19