as                  package:fSeries                  R Documentation

_t_i_m_e_S_e_r_i_e_s _C_l_a_s_s, _C_o_e_r_c_i_o_n _a_n_d _T_r_a_n_s_f_o_r_m_a_t_i_o_n

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

     A collection and description of functions  and methods dealing
     with the coercion of 'timeSeries' objects.        

     Functions to create 'timeSeries' objects from other objects:

       'as.timeSeries'              Generic function to convert a 'timeSeries' object,
       'as.timeSeries.default'      Returns unchanged the 'timeSeries' object,
       'as.timeSeries.numeric'      Converts from a numeric vector,
       'as.timeSseries.data.frame'  Converts from a numeric vector,
       'as.timeSeries.matrix'       Converts from a matrix,
       'as.timeSeries.ts'           Converts from an object of class 'ts',
       'as.timeSeries.character'    Converts from a named demo file,
       'as.timeSeries.zoo'          Converts an object of class zoo.

     Functions to transform 'timeSeries' objects into other objects:

       'as.vector.timeSeries'      Coerces a 'timeSeries' to a vector,
       'as.matrix.timeSeries'      Coerces a 'timeSeries' to a matrix,
       'as.data.frame.timeSeries'  Coerces a 'timeSeries' to a data.frame,
       'as.ts.timeSeries'          S3: Coerces a 'timeSeries' to a 'ts' object.

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

        
     is.timeSeries(object)
     ## S3 method for class 'numeric':
     as.timeSeries(x, ...)
     ## S3 method for class 'data.frame':
     as.timeSeries(x, ...)
     ## S3 method for class 'matrix':
     as.timeSeries(x, ...)
     ## S3 method for class 'ts':
     as.timeSeries(x, ...)
     ## S3 method for class 'character':
     as.timeSeries(x, ...)
     ## S3 method for class 'zoo':
     as.timeSeries(x, ...)
      
     ## S3 method for class 'timeSeries':
     as.vector(x, mode = "any")
     ## S3 method for class 'timeSeries':
     as.matrix(x, ...)
     ## S3 method for class 'timeSeries':
     as.data.frame(x, row.names = NULL, optional = NULL, ...)
     ## S3 method for class 'timeSeries':
     as.ts(x, ...)

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

    mode: a character string giving an atomic mode or '"list"',  or
          (not for 'vector') '"any"'. 

  object: an object of class 'timeSeries'. 

optional: A logical value. If 'TRUE', setting row names and converting 
          column names (to syntactic names) is optional. 

row.names: 'NULL' or a character vector giving the row names for the
          data frame. Missing values are not allowed. 

       x: an object which is coerced according to the generic function. 

     ...: arguments passed to other methods. 

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

     'is.timeSeries' 
      returns 'TRUE' or 'FALSE' depending on whether its argument is of
     'timeSeries' type or not. 

     'as.timeSeries'

      returns a S4 object of class 'timeSeries'. 

     'as.vector'
      'as.data.frame'
      'as.matrix'
      'as.ts' 
      return depending on the generic function a numeric vector, a 
     data frame, a matrix, or an object of class 'ts'.

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

     Diethelm Wuertz for the Rmetrics R-port.

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

     ## data - timeSeries:
        # Create an artificial timeSeries object:
        myFinCenter <<- "GMT"
        charvec = timeCalendar()
        data = matrix(rnorm(12))
        TS = timeSeries(data, charvec, units = "RAND")
        TS

     ## Test for timeSeries:
        is.timeSeries(TS)
        
     ## As Vector:
        as.vector(TS)
        
     ## As Matrix or Data Frame:
        as.matrix(TS)
        as.data.frame(TS)
        
     ## As Univariate Object of Class 'ts':
        as.ts(TS)

