plot.segmentation        package:tilingArray        R Documentation

_P_l_o_t _r_e_s_u_l_t _o_f _s_e_g_m_e_n_t_a_t_i_o_n _a_l_g_o_r_i_t_h_m

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

     This function visualizes the result of 'findSegments'. The user
     can choose whether he wants to specify the number of segments or
     let be determined by the function (see details).

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

       ## S3 method for class 'segmentation':
       plot(x, nSegments = NULL, bcol = NULL, from=NULL, to=NULL, ...)

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

       x: object of class '"segmentation"'

nSegments: number of segments in the data; if 'NULL', it is determined
          within the function (see details)

    bcol: color(s) to use for segment borders; if 'NULL' they are taken
          to be the colors 2:'nSegments'

    from: numeric, index of data point to start plot at; default 'NULL'
          means take the first one

      to: numeric, index of last data point to plot; default 'NULL'
          means take all up to the last one

     ...: further graphical parameters passed on to 'plot.default'

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

     If 'nSegments' is not specified, it is taken to be that number, at
     which the Residual Sum of Squares shows the largest decrease from
     the previous one. (The RSS decreases steadily, so absolute minimum
     is reached when 'nSegments' equals the number of observations.
     This can only be done if confidence intervals have been computed
     for at least one of the segmentations, using the function
     'confint.segmentation'.

_V_a_l_u_e:

     If result is assigned, returns a list containing 

  breakp: the breakpoints of the chosen or computed segmentation

 confInt: the confidence intervals of those breakpoints

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

     Joern Toedling toedling@ebi.ac.uk

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

     'findSegments', 'confint.segmentation'

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

       dat <- c(rnorm(10,0,1),rnorm(20,2,1), rnorm(5,0.5,0.5),
                rnorm(10,1,1), rnorm(20,2,1))

       if (require("strucchange")){
         segres <- findSegments(dat, maxcp=10, maxk=15, verbose=TRUE)
         segres <- confint(segres, 3:6)
         plot(segres)
       } else {
         segres <- findSegments(dat, maxcp=10, maxk=15, verbose=TRUE) 
         plot(segres, 5)
       }

