I am trying to plot the completeness of the follow-up plot in r
but I am experiencing a problem with x-axis in plotting date in a proper format although I put it in the correct format in the dataset using POSIXct
My code and sample dataset:
Date.Interventon = as.POSIXct('1/27/2017', format='%m/%d/%Y') + 1:40*60
Status<- c ("Alive","Dead","Dead","Dead","Alive","Alive","Dead","Dead","Alive","Dead")
OS.years <-c(11,13,14,13,13,10,13,14,10,11)
data.fu.lorenzoo= data.frame(Date.Interventon,Status, OS.years)
str(Date.Interventon )
library(car)
scatterplot( OS.years ~ Date.Interventon | Status, data=data.fu.lorenzoo,
xlab = "Date of procedure",
ylab = "Follow-up (years)",
smooth = F, # Removes smooth estimate
regLine = T) # Removes linear estimate
The resulting plot is shown below.
I did many trials but I am still struggling.
Any advice will be greatly appreciated.