【发布时间】:2015-09-17 22:07:49
【问题描述】:
在以下非常简单的示例中,我无法理解“==”运算符的行为。
A <- c(10, 20, 10, 10, 20, 30)
B <- c(40, 50, 60, 70, 80, 90)
df <- data.frame(A, B)
df[df$A == c(10,20), ] # it returns 3 lines instead of 5
df[df$A %in% c(10,20), ] # it works properly and returns 5 lines
提前谢谢大家。
【问题讨论】:
标签: r