Belows是我选择属性的代码"航空公司"等于" CX"," GA"," HX"或" RI"仅
Result <- Result[which(Result$Airline == "CX" | Result$Airline == "GA" |
Result$Airline == "HX" | Result$Airline == "RI"),]
我想问一下R中是否有类似OR(Result$Airline, c("CX","GA","HX","RI"))
的内容?
感谢您的温和帮助。
答案 0 :(得分:3)
尝试:
Result <- Result[which(Result$Airline %in% c( "CX","GA","HX","RI"),]