I am a really newbie of R and I have the following dataframe named (errore33):
LVCSERIALNUMBER ADGIS SERIALNUMBER EXECOUNT ERRCOUNT PLCCOMMUNICATIONSTATUS
36236 14CEC50610022451 ca0a1c0054e9 1.009143e+15 27 1 0
106219 14CEC50610022451 ca0a1c005848 1.009143e+15 25 2 0
106230 14CEC50610022451 ca0a1c0065b0 1.009143e+15 25 2 0
106355 14CEC50610022451 ca0a1c005a59 1.009143e+15 25 2 0
106423 14CEC50610022451 ca0a1c0064b3 1.009143e+15 25 2 0
In addition I have another dataframe called tabellacompleta1
LVC_ID TAB_CE_ADGIS STATUS ROW_NUM TAB_CE_COMMUNICATION_LINE T_RPT_HOP_TABLE_PRI_1 T_RPT_HOP_TABLE_PRI_2 T_RPT_HOP_TABLE_PRI_3
1 "14CEC50610022451" "1.009163e+15" "RAG" " 1" " 11" "172" "191" " 5"
2 "14CEC50610022451" "1.009151e+15" "RAG" " 2" " 1011" " 0" " 0" " 0"
3 "14CEC50610022451" "1.009162e+15" "RAG" " 3" " 1011" " 0" " 0" " 0"
4 "14CEC50610022451" "1.009162e+15" "RAG" " 4" "10001011" " 3" " 0" " 0"
5 "14CEC50610022451" "1.009143e+15" "RAG" " 5" "10000011" "172" "191" " 42"
Now my problem is to add a column to errore33 with the numeric value of ROW_NUM column when the following condition happens errore33.SERIALNUMBER == tabellacompleta1.TAB_CE_ADGIS
Just to clarify, in case of the first serialnumber == the third tab_ce_adgis then i have to add in the first position of errore33 in the newcolumn the numeric value 3 (the numeric value of ROW_NUM)