dcut                   package:emu                   R Documentation

_F_u_n_c_t_i_o_n _t_o _e_x_t_r_a_c_t _a _v_e_c_t_o_r _o_r _m_a_t_r_i_x _f_r_o_m  _E_M_U-_T_r_a_c_k_d_a_t_a _a_t _a _s_i_n_g_l_e _t_i_m_e _p_o_i_n_t _o_f _t_o _c_r_e_a_t_e _a_n_o_t_h_e_r _E_M_U-_t_r_a_c_k_d_a_t_a _o_b_j_e_c_t _b_e_t_w_e_e_n _t_w_o _t_i_m_e_s.

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

     A general purpose tool for extracting data from track objects
     either at a particular time, or between two times. The times can
     be values in milliseconds or proportional times between zero (the
     onset) and one (the offset).

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

     dcut(trackdata, left.time, right.time, single = TRUE, average = TRUE, prop = FALSE)

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

trackdata: An Emu trackdata object. 

left.time: Either: a numeric vector of the same length as there are
          obsverations in trackdata. Or: a single value between 0 and
          1. In the first case, the left time boundary of trackdata[n,]
          is cut at left.time[n],  in the second case, and if prop=T,
          it is cut at that proportional time. 

right.time: Either: a numeric vector of the same length as there are
          obsverations in trackdata. Or: a single value between 0 and
          1. In the first case, the right time boundary of
          trackdata[n,] is cut at right.time[n],  in the second case,
          and if prop=T, it is cut at that proportional time. 

  single: If TRUE, one value is returned per segment. This applies when
          the requested time falls between two track frames. When
          single=TRUE, the preceding value is returned, unless
          average=TRUE (see below), in which case the average value of
          the two frames is returned. when the right.time argument is
          omitted 

 average: A single element logical vector - see single above. Applies
          only when the right.times argument is omitted and when single
          = TRUE  

    prop: If TRUE left.time and right.time are interpreted as
          proportions, if FALSE, they are interpreted as millisecond
          times

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

     This function extracts data from each segment of a trackdata
     object. 

     If 'prop=FALSE' the time arguments ('left.time' and 'right.time')
     are interpreted as millisecond times and each should be a vector
     with the same length as the number of segments in 'trackdata'.  If
     'prop=TRUE' the time arguments should be single values between
     zero (the onset of the segment) and one (the offset).  

     If 'right.time' is omitted then a single data point correponding
     to 'left.time' for each segment is returned.

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

     A trackdata object if both 'left.time' and 'right.time' are
     specified, otherwise a matrix if 'right.time' is unspecified and
     the trackdata object has multiple columns of data or a vector if
     right.time' is unspecified and the trackdata object has a single
     column of data.

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

     Jonathan Harrington

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

     'emu.track',   'dplot', 'eplot'

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

          # the data values of the trackdata object at the temporal midpoint
          # (midvals is matrix of F1 and F2 data)
          dip.fdat[1:10]
          midvals <- dcut(dip.fdat, 0.5, prop=TRUE)
          midvals[1:10,]
          
          
          # the data values of the trackdata object between 
          # extending from 20
          # (bet is a trackdata object of F1 and F2 values)
          bet <- dcut(dip.fdat, 0.2, 0.8, prop=TRUE)
          bet[1]
          

          # the data values of the trackdata object at 30 ms after
          # the start time of the trackdata object
          # (time30 is a matrix of F1 and F2 data
          times <- dip.fdat$ftime[,1]+30
          times[1:10]
          time30 <- dcut(dip.fdat, times)
          time30[1:10]
          

          # the data values of the trackdata object 
          # between the  start time and 30 ms after the start  time
          # (int is a trackdata object of F1 and F2 values extending
          # from the start of the diphthongs up to 30 ms after the diphthongs)
          int <- dcut(dip.fdat, dip.fdat$ftime[,1], times)
          int[1]
      

