weeks                package:quantmod                R Documentation

_E_x_t_r_a_c_t _W_e_e_k_s, _Y_e_a_r_s _o_f _a _T_i_m_e _S_e_r_i_e_s _O_b_j_e_c_t

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

     Extract weeks and years. This is a generic function, methods for
     zoo classes are documented here

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

     ## S3 method for class 'zoo':
     weeks(x, abbreviate)

     ## S3 method for class 'zoo':
     years(x, abbreviate)

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

       x: zoo object with index of class Date 

abbreviate: abbreviate the results 

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

     Behaves exactly as weekdays, months and quarters from 'base' with
     the obvious difference in that the method extracts the weeks or
     years of the object.

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

     A numeric vector giving the week number of the year corresponding
     to each observed date for 'weeks', and year in CCYY-MM-DD format
     for 'years'.

_N_o_t_e:

     The zoo object's index must be of class Date, or coercible to
     such.

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

     Jeffrey A. Ryan

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

     zoo

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

     'weekdays', 'Date'

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

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

