I am trying to compare the current row with the previous row. If the string matches it should keep the same number. If the string doesn't match, it needs to add to a counter on a separate row.
This is what I have.
Error NIO belt full
Error NIO belt full
Error transport - x axis error [70MA1]
Error loading - lifter hp [341BG4 + 341BG6] not reached
Place LF - NIO Station6 graph windows 2 out of
Error loading - scanner not ready
Error loading - scanner not ready
This is that I need
I have tried the following code
knime.out <- knime.in n <- nrow(knime.in) knime.in$record_number <- rep(0, n) r_num <- 1 for (i in 1:n) { knime.in$record_number[i] <- r_num if(knime.in$"combined_string" == lag(knime.in$"combined_string",k=1:) { r_num <- r_num+1 } }