Questions tagged «multiple-conditions»

4
在dplyr中的字符串列上过滤多个值
我data.frame在其中一列中有一个字符数据。我想data.frame从同一列中过滤多个选项。有没有一种简单的方法可以做到这一点,而我却缺少了? 示例: data.frame名称=dat days name 88 Lynn 11 Tom 2 Chris 5 Lisa 22 Kyla 1 Tom 222 Lynn 2 Lynn 我想筛选出Tom与Lynn例如。 当我做: target <- c("Tom", "Lynn") filt <- filter(dat, name == target) 我收到此错误: longer object length is not a multiple of shorter object length
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.