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