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 %와`==`의 차이점
df$time == c(0.5,3)
에서
[비디오 번호 # 033] (http://www.twotorials.com/)에 관심이있을 수있는 R –
에서 '?'== '및 %?'를 참조하십시오. –