coredata                 package:zoo                 R Documentation

_E_x_t_r_a_c_t_i_n_g/_R_e_p_l_a_c_i_n_g _t_h_e _C_o_r_e _D_a_t_a _o_f _O_b_j_e_c_t_s

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

     Generic functions for extracting the core data contained in a
     (more complex) object and replacing it.

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

     coredata(x, ...)
     coredata(x) <- value

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

       x: an object.

     ...: further arguments passed to methods.

   value: a suitable value object for use with 'x'.

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

     In 'zoo', there are currently 'coredata' methods for time series
     objects of class '"zoo"', '"ts"', '"its"', '"irts"', all of which
     strip off the index/time attributes and return only the
     observations. The are also corresponding replacement methods for
     these classes.

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

     'zoo'

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

     x.date <- as.Date(paste(2003, rep(1:4, 4:1), seq(1,20,2), sep = "-"))
     x <- zoo(matrix(rnorm(20), ncol = 2), x.date)

     ## the full time series
     x
     ## and only matrix of observations
     coredata(x)

     ## change the observations
     coredata(x) <- matrix(1:20, ncol = 2)
     x

