hello, here is my dataset obtained from datapasta:
data.frame(
stringsAsFactors = FALSE,
patient_ID = c("1","2","3","4","5","6",
"7","8","9","10","11","12","13","14","15","16",
"17","18","19"),
Time = c(1596,1514,356,2085,1921,
318,83,328,815,1854,159,240,821,720,2315,1800,99,
205,177)
I'm trying to obtain a Swimmer's plot for this data. I have entered the following:
H_N_outcomes_first20$Time <- as.numeric(H_N_outcomes_first20$Time)
H_N_outcomes_first20$patient_ID <- as.character(H_N_outcomes_first20$patient_ID)
swimmer_plot(df=H_N_outcomes_first20, id="patient_ID", end= "Time", fill='lightblue', width=0.85)
I get the following error message:
Error in model.frame.default(formula = df[, end] ~ df[, id]) :
invalid type (list) for variable 'df[, end]'
Can someone please help?
Thanks