循环有点问题。这是循环的代码:
for(i in 2 : seq_along(dfpl$jobid_c)){
if ((dfpl$jobid_c[i]>0) & (dfpl$job_id[i]==0) ){
j = (i-1)
dfpl$formula_code[i] = dfpl$formula_code[j]
dfpl$formula_date[i] = dfpl$formula_date[j]
dfpl$formula_name[i] = dfpl$formula_name[j]
}
else{
}
}
Error in dfpl$formula_code[i] <- dfpl$formula_code[j] :
replacement has length zero
In addition: Warning message:
In 2:seq_along(dfpl$jobid_c) :
numerical expression has 4205 elements: only the first used