我想找到多个字符串并将其放入一个变量中,但是我不断收到错误。
queries <- httpdf %>% filter(str_detect(payload, "create" || "drop" || "select"))
Error: invalid 'x' type in 'x || y'
queries <- httpdf %>% filter(str_detect(payload, "create" | "drop" | "select"))
Error: operations are possible only for numeric, logical or complex types
queries1 <- httpdf %>% filter(str_detect(payload, "create", "drop", "select"))
Error: unused arguments ("drop", "select")
这些都不起作用。有没有其他方法可以做到这一点,str_detect
或者我应该尝试其他方法吗?我希望它们也显示在同一列中。