how to remove rows with a certain value in r code example Example: r remove inf values df <- df[!is.infinite(rowSums(df)),]