Hi Meg,
Thanks for the data but probably the best way to supply sample data is by using the dput() function. It gives an exact copy of your data.
Anyway, is this what you want?
df <- structure(list(ID = c(1, 2, 3, 4), visitdate = structure(c(11028,
16044, 12926, 17492), class = "Date"), dateofdiagnosis = structure(c(10968,
NA, 16022, 16022), class = "Date"), Illness = c("Cancer", "None",
"Cancer", "Cancer")), row.names = c(NA, 4L), class = "data.frame")
## convert character variables to dates.dates
library(lubridate)
df$visitdate <- ymd(df$visitdate)
dfateofdiagnosis <- ymd(df$dateofdiagnosis)
## subset
df2 <- subset(df, df$visitdate >= df$dateofdiagnosis | is.na(dateofdiagnosis ))
df2
BTW 2013- 11-13 in your example has an extra space in it.