Skip to contents
# For vignette demonstration, ensure 'treatmentResponse' is available.
# This data is part of the ClinicoPathDescriptives package.
data(treatmentResponse, package = "ClinicoPathDescriptives")
if (!exists("treatmentResponse")) {
  set.seed(123)
  
  # Step 1: Create the data frame with the first two columns.
  treatmentResponse <- data.frame(
    patientID = 1:50,
    change = round(c(rnorm(25, -40, 20), rnorm(25, 20, 25)))
  )
  
  # Step 2: Now that 'treatmentResponse$change' exists, create the responseCategory column.
  treatmentResponse$responseCategory <- factor(
    ifelse(treatmentResponse$change <= -30, "Partial Response",
      ifelse(treatmentResponse$change >= 20, "Progressive Disease", "Stable Disease")
    )
  )
}
head(treatmentResponse)
library(jsurvival)

# Check available variables in treatmentResponse
cat("Available variables in treatmentResponse:\n")
print(names(treatmentResponse))

# Basic waterfall plot example
cat("\nWaterfall plot functionality available with appropriate data structure")
cat("\nRequired variables: PatientID, ResponseValue, Month")
# Waterfall plot output would be displayed here
cat("Waterfall plot visualization available with proper data structure")