我在R中有一个数据框,它有2个数字字段,其中1个字段可以包含NA值。
我想绘制第一个字段并在第二个字段为NA时关闭col。
CurrentBackLog = as.data.frame(list(DaysSinceCreted = c(34,50,22,6),DaysSinceReady = c(NA,10,22,NA)))
这只显示DaysSinceReady不是NA的项目......
plot(CurrentBackLog$DaysSinceCreated,
main = 'Days Since Created by Ticket',
ylab = 'Days Since Created',
pch = 15,
col = ifelse(CurrentBackLog$DaysSinceReady>1,'red','blue')
)