尝试过滤只包含单词DEV的行,但是下面的内容也是错误的匹配,比如SEV、HEV和BEV。
数据
Airport_ID<-c("3001","3002","3003","3004")
Airport_Name<-c("Adelaide DEV DTSUpdated","Brisbane HEV Land Airport Land ADTS",
"Washington SEV INC Airport DTSUpdated","DALLAS Airport BEV INCUpdated")
dfu<-data.frame(Airport_ID,Airport_Name)过滤码
Filter_Data <- dfu %>%
dplyr::filter(grepl(" \\DEV\\ ",Airport_Name))预期产出:
3001 Adelaide DEV DTSUpdated发布于 2022-07-23 22:42:30
只管用
library(dplyr)
dfu |> filter(grepl("DEV" , Airport_Name , fixed = T)) Airport_ID Airport_Name
1 3001 Adelaide DEV DTSUpdatedhttps://stackoverflow.com/questions/73094656
复制相似问题