library(ggplot2)
ggplot(heart_transplant, aes(x = transplant, y = survtime)) +
geom_boxplot() +
labs(x = "Transplant", y = "Survival time (days)")
ggplot(heart_transplant, aes(x = transplant, fill = survived)) +
geom_bar(position = "fill") +
labs(x = "Transplant", y = "Proportion", fill = "Outcome")
Run the code above in your browser using DataLab