plotOptimalLine            package:rattle            R Documentation

_P_l_o_t _t_h_r_e_e _l_i_n_e_s _o_n _a _r_i_s_k _c_h_a_r_t, _o_n_e _v_e_r_t_i_c_a_l _a_n_d _t_w_o _h_o_r_i_z_o_n_t_a_l

_D_e_s_c_r_i_p_t_i_o_n:

     Plots a a vertical line at x up to max of y1 and y2, then
     horizontal from this line at y1 and y2. Intended for plotting on a
     plotRisk.

_U_s_a_g_e:

     plotOptimalLine(x, y1, y2, pr = NULL, colour = "plum", label = NULL)

_A_r_g_u_m_e_n_t_s:

       x: location of vertical line.

      y1: location of one horizontal line.

      y2: location of other horizontal line.

      pr: Aprint a percentage at this point.

  colour: of the line.

   label: at bottom of line.

_D_e_t_a_i_l_s:

     Intended to plot an optimal line on a Risk Chart as plotted by
     plotRisk.

_A_u_t_h_o_r(_s):

     Graham.Williams@togaware.com

_R_e_f_e_r_e_n_c_e_s:

     Package home page: <URL: http://rattle.togaware.com>

_S_e_e _A_l_s_o:

     'plotRisk'.

_E_x_a_m_p_l_e_s:

     ## this is usually used in the context of the plotRisk function
     ## Not run: ev <- evaluateRisk(predicted, actual, risk)

     ## imitate this output here
     ev <- NULL
     ev$Caseload  <- c(1.0, 0.8, 0.6, 0.4, 0.2, 0)
     ev$Precision <- c(0.15, 0.18, 0.21, 0.25, 0.28, 0.30)
     ev$Recall    <- c(1.0, 0.95, 0.80, 0.75, 0.5, 0.0)
     ev$Risk      <- c(1.0, 0.98, 0.90, 0.77, 0.30, 0.0)

     ## plot the Risk Chart
     plotRisk(ev$Caseload, ev$Precision, ev$Recall, ev$Risk,
              chosen=60, chosen.label="Pr=0.45")

     ## plot the optimal point
     plotOptimalLine(40, 77, 75, colour="maroon")

