# Data:
x <- seq(0, 100, by = 10)
y <- c(0, 0, 0, 8, 24, 50, 70, 80, 83, 85, 85)
# Basic versions:
plot_crisk(x, y) # using data provided
plot_crisk(x, y, x_from = 40) # use and mark 1 provided point
plot_crisk(x, y, x_from = 44) # use and mark 1 predicted point
plot_crisk(x, y, x_from = 40, x_to = 60) # use 2 provided points
plot_crisk(x, y, x_from = 44, x_to = 64) # use 2 predicted points
plot_crisk(x, y, fit_curve = TRUE) # fitting curve to provided data
# Training versions:
plot_crisk(x, y, 44, 64, show_pas = TRUE) # past/passed risk only
plot_crisk(x, y, 44, 64, show_rem = TRUE) # remaining risk only
plot_crisk(x, y, 44, 64, show_pas = TRUE, show_rem = TRUE) # both risks
plot_crisk(x, y, 44, 64, show_aux = TRUE) # auxiliary lines + axis
plot_crisk(x, y, 44, 64, show_aux = TRUE, show_pop = TRUE) # + population parts
plot_crisk(x, y, 44, 64, show_aux = TRUE, show_num = TRUE) # + numeric values
plot_crisk(x, y, 44, 85, show_aux = TRUE, show_pop = TRUE, show_num = TRUE) # + aux/pop/num
# Note: Showing ALL is likely to overplot/overwhelm:
plot_crisk(x, y, x_from = 47, x_to = 67, fit_curve = TRUE,
main = "The main title", sub = "Some subtitle",
show_pas = TRUE, show_rem = TRUE, show_aux = TRUE, show_pop = TRUE,
show_num = TRUE, show_inc = TRUE, show_grid = TRUE, mar_notes = TRUE)
# Small x- and y-values and linear increases:
plot_crisk(x = 2:10, y = seq(12, 28, by = 2), x_from = 4.5, x_to = 8.5,
show_pas = TRUE, show_rem = TRUE, show_aux = TRUE, show_pop = TRUE,
show_num = TRUE, show_inc = TRUE)
Run the code above in your browser using DataLab