r remove rows with certain string code example
Example 1: r remove inf values
df <- df[!is.infinite(rowSums(df)),]
Example 2: delete all rows that contain a string in R
library(dplyr)
df %>%
filter(!grepl('REVERSE', Name))
Example 3: delete all rows that contain a string in R
library(stringr)
df %>%
filter(!str_detect(Name, 'REVERSE'))
Example 4: delete rows from string vector r according to regex
df[ grep("REVERSE", df$Name, invert = TRUE) , ]