Skip to content

Instantly share code, notes, and snippets.

@statwonk
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statwonk/9449792 to your computer and use it in GitHub Desktop.
Save statwonk/9449792 to your computer and use it in GitHub Desktop.
difftime(Sys.time(), min(df$date_put_on_list[df$censor == 0]), units = "days")
Time difference of 15892.45 days
df$days_to_capture <- ifelse(df$id == 313, 15892.45, df$days_to_capture)
mean(df$days_to_capture[df$days_to_capture > 0 & (df$censor == 1 | df$id == 313)], na.rm = T)
# 435.1818 days
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment