我有一个这样的数据框
xx
dput(head(xx,10))
structure(list(JobName = c("EXBCV01D", "EXBCV01D", "EXBCV01D",
"EXBCV01D", "EXBCV01D", "EXBCV01D", "EXBCV01D", "EXBCV01D", "EXBCV01D",
"EXBCV01D"), Date = c(120820L, 120817L, 120816L, 120815L, 120814L,
120813L, 120810L, 120809L, 120808L, 120807L), TargetDate = c(NA_integer_,
NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_,
NA_integer_, NA_integer_, NA_integer_, NA_integer_)), .Names = c("JobName",
"Date", "TargetDate"), row.names = c(NA, 10L), class = "data.frame")
我需要抓取目标不是的所有行
我正在做这个 xxx<-with(xx, xx[!is.na(TargetDate), ])
我明白了:
head(xxx)
JobName Date TargetDate
2689 EXBCV06D 120820 -1
2690 EXBCV06D 120820 -1
2691 EXBCV06D 120820 -1
2692 EXBCV06D 120820 -1
2693 EXBCV06D 120817 -1
2694 EXBCV06D 120817 -1
我在同一日期收到多个 JobName。这里发生了一些奇怪的事情。