breakpoints             package:quantmod             R Documentation

_L_o_c_a_t_e _B_r_e_a_k_p_o_i_n_t_s _b_y _D_a_t_e

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

     Extract index values of a given zoo object, where the returned
     index is equal to the last date of each  recurring period.

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

     breakpoints(x, by = c(weekdays, weeks, months, quarters, years),
                 ...)

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

       x: zoo object with index of class 'Date' 

      by: period to be indexed from 

     ...: currently unused 

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

     Given a 'zoo' object with the appropriate index type,
     'breakpoints' will return a numeric vector corresponding to the
     final rows in each period specified.

     For example, 'by=years' would return the index values matching the
     last observation in each calendar year. Similarly, 'by=weeks'
     would match the last observations in any given week.

     The final index returned corresponds to the last observation in
     the data object, as this may be useful for calculating "values to
     date".

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

     A numeric vector which can be used to extract rows from the given
     data object.

_N_o_t_e:

     The last value in the returned vector _most likely_ does not mark
     the end of the specified period, rather it marks the end of the
     data.

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

     Jeffrey A. Ryan

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

     'period.apply' calculate values for each interval

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

     zoo.data <- zoo(rnorm(31)+10,as.Date(13514:13744,origin="1970-01-01"))
     breakpoints(zoo.data,by=weeks)

     bp <- breakpoints(zoo.data,by=quarters)
     zoo.data[bp]

