buildData              package:quantmod              R Documentation

_C_r_e_a_t_e _D_a_t_a _O_b_j_e_c_t _f_o_r _M_o_d_e_l_l_i_n_g

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

     Create one data object from multiple sources, applying
     transformations via standard R formula mechanism.

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

     buildData(formula, na.rm = TRUE, return.class = "zoo")

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

 formula: an object of class 'formula' (or one that can be coerced to
          that class): a symbolic description of the desired output
          data object, with the 'dependent' side corresponding to first
          column, and the 'independent' parameters of the formula
          assigned to the remaining columns. 

   na.rm: drop rows with missing values? 

return.class: one of "zoo","data.frame","ts","its","timeSeries" 

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

     Makes available for use _outside_ the 'quantmod' workflow a
     dataset of appropriately transformed variables, using the same
     mechanism underlying 'specifyModel'. Offers the ability to apply
     transformations to raw data using a common formula mechanism,
     without having to explicitly merge different data objects.

     Interally calls 'specifyModel' followed by 'modelData', with the
     returned object being coerced to the desired 'return.class' if
     possible, otherwise returns a 'zoo' object.

     See 'getSymbols' and 'specifyModel' for more information regarding
     proper usage.

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

     An object of class 'return.class'.

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

     Jeffrey A. Ryan

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

     'getSymbols', 'specifyModel', 'modelData'

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

     ## Not run: 
       buildData(Next(OpCl(DIA)) ~ Lag(TBILL) + I(Lag(OpHi(DIA))^2))
       buildData(Next(OpCl(DIA)) ~ Lag(TBILL), na.rm=FALSE)
       buildData(Next(OpCl(DIA)) ~ Lag(TBILL), na.rm=FALSE, return.class="ts")
     ## End(Not run)

