sachsmc / ggkm

Compute and display Kaplan-Meier Curves with ggplot2
Other
22 stars 4 forks source link

Seeing error when trying to pass raw data to geom_km() #4

Closed ndrewwm closed 8 years ago

ndrewwm commented 8 years ago

Same session info as #3.

df <- data.frame(
  outcome   = rbinom(200, 1, prob  = .25),
  duration  = sample(1:500, 200, replace = TRUE)
)

sapply(df, is.numeric)
# outcome duration 
#    TRUE     TRUE 

ggplot(df, aes(x = duration, status = outcome)) + geom_km()
Warning message:
Computation failed in `stat_km()`:
Time variable is not numeric
sachsmc commented 8 years ago

change x to time in aes()