remove inf from data frame r code example Example: r remove inf values df <- df[!is.infinite(rowSums(df)),]