itsSubset                package:its                R Documentation

_R_a_n_g_e _a_n_d _E_x_t_r_a_c_t _f_o_r _I_r_r_e_g_u_l_a_r _T_i_m_e-_S_e_r_i_e_s _O_b_j_e_c_t_s

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

     Range and extract for objects of class '"its"'.

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

     rangeIts(x,start=dates(x)[1],end=dates(x)[n],format=its.format(),...)
     extractIts(x,weekday=FALSE,find=c("all","last","first"),period=c("week","month"),partials=TRUE,select)
     x[i,j,dates]

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

       x: an object of class '"its"'

start, end: POSIXct or character representation of the start or end
          time-stamp,  if character, then the format is as specified by
          the argument 'format'

  format: format of '"start"' and '"end"' dates, see 'format.POSIXct'.

     i,j: indices specifying the parts to be extracted from the
          irregular time-series object

   dates: POSIX dates specifying the timestamps of rows to be extracted
          from the irregular time-series object

     ...: further arguments passed to 'as.POSIXct'

 weekday: logical, defines whether only weekdays are to be returned

    find: to find the first, last, or all samples within each period

  period: the period within which 'find' and/or 'select' operate

partials: defines whether the first (possibly incomplete) period is
          processed  for find=first, and whether the last is processed
          for find=last

  select: an integer vector defining one or more days to select.  The
          integer  specifies 'wday' (for period=week) or 'mday' (for
          period=month).  See  'as.POSIXlt' for details

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

     'rangeIts' selects a range of rows that fall between two times,
     specified in text format.

     'extractIts' selects a subset of rows that obey some sort of
     semi-regular rule such as monthends, weekdays, and so on.  The
     order of application is 'weekday', 'find',  then 'select'.

     'x[i,j,dates]' extractor method for an irregular time-series: 'i'
     and 'dates' are mutually exclusive alternatives for specifying
     rows.  It proceeds as for a matrix, with the  exception that
     drop=FALSE is enforced, so the result always inherits from matrix.

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

     An object of class '"its"'.

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

     Giles Heywood

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

     'ts', 'POSIXct', 'itsFile', 'itsLags', 'itsJoin', 'itsTimes',
     'itsSubset', 'itsFin', 'itsDisp', 'itsInfo', 'itsCumdif',
     'itsArith'

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

     its.format("%Y-%m-%d")
     b <- newIts(start="2003-01-01",end="2003-01-20")
     rangeIts(b,start = "2003-01-05" ,end= "2003-01-15")
     rangeIts(b,start = ISOdate(2003,1,5,hour=0) ,end= ISOdate(2003,1,15,hour=0))
     b[1:3,]
     b[,1]
     b[,dates=ISOdate(2003,1,1,hour=0)]
     its.format("%a %d %b %Y")
     c <- newIts()
     extractIts(c,weekday=TRUE,period="month",find="last")  #the last weekdays of the month in c

