r - invalid factor level, NA generated when I try to add row to dataframe with var1 and Freq -
i have data frame, head of is: head(loss_freq_table) var1 freq 1 1101 19 2 1102 18 3 1103 12 4 1104 19 5 1105 16 6 1106 12 however, when type loss_by_team<-rbind(loss_by_team, data.frame(var1=1455, freq=0)) , error warning message: in `[<-.factor`(`*tmp*`, ri, value = 1455) : invalid factor level, na generated and when type loss_by_team[which(loss_by_team$var1=="1455"), ] , get [1] var1 freq <0 rows> (or 0-length row.names) anyone know why is?