从数据框中选择与查询不匹配的行

时间:2018-02-19 18:10:23

标签: r

正如您可以通过R看到此选择,显示状态不同于'打开'并且还有以下类型的宝马,大众和奔驰。 如何运行此查询的相反选择:

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

1 个答案:

答案 0 :(得分:0)

正如@akrun建议你可以简单地在括号外插入!来否定整个句子

df = df[ !(df$status != "Open" & df$Type %in% c("BMW","VW","BENZ")), ]

或者你可以“分发”not运算符: teste

df = df[ df$status == "Open" | !(df$Type %in% c("BMW","VW","BENZ")), ]