我有一个数据框,其头部是:
head(loss_freq_table)
Var1 Freq
1 1101 19
2 1102 18
3 1103 12
4 1104 19
5 1105 16
6 1106 12
但是,当我输入loss_by_team<-rbind(loss_by_team, data.frame(Var1=1455, Freq=0))
时,我收到错误
Warning message:
In `[<-.factor`(`*tmp*`, ri, value = 1455) :
invalid factor level, NA generated
当我输入loss_by_team[which(loss_by_team$Var1=="1455"), ]
时,我得到了
[1] Var1 Freq
<0 rows> (or 0-length row.names)
谁知道为什么会这样?