transmute new columns based on exact match of multiple words in string
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a data frame: df <- data . frame ( Otherspp = c ( "suck SD" , "BT" , "SD RS" , "RSS" ), Dominantspp = c ( "OM" , "OM" , "RSS" , "CH" ), Commonspp = c ( " " , " " , " " , "OM" ), Rarespp = c ( " " , " " , "SD" , "NP" ), NP = rep ( "northern pikeminnow|NORTHERN PIKEMINNOW|np|NP|npm|NPM" , 4 ), OM = rep ( "steelhead|STEELHEAD|rainbow trout|RAINBOW TROUT|st|ST|rb|RB|om|OM" , 4 ), RSS = rep ( "redside shiner|REDSIDE SHINER|rs|RS|rss|RSS" , 4 ), suck = rep ( "suckers|SUCKERS|sucker|SUCKER|suck|SUCK|su|SU|ss|SS" , 4 ) ) I need to