longitudinal          package:longitudinal          R Documentation

_D_a_t_a _S_t_r_u_c_t_u_r_e _f_o_r _L_o_n_g_i_t_u_d_i_n_a_l _D_a_t_a

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

     The data type 'longitudinal' stores multiple time series data.  It
     allows repeated measurements, irregular sampling, and unequal
     temporal spacing of the time points. 

     'as.longitudinal' converts a matrix into a 'longitudinal' object. 
     The columns of the input matrix are considered as individual
     variables (time series).  The rows contain the measurements in
     temporal order (for instance, rows 1-10 could contain 10 repeated
     measurements taken at time point 1, rows 11-20 further 10
     measurements taken at time point 2, and so on). The dates for the
     time points can be specified with the argument 'times' and need
     not be equally spaced.  With the argument 'repeats' it is possible
     to specify the number of measurements per time point (this may be
     different from time point to time point).  In the resulting
     'longitudinal' matrix object the row names will indicate both the
     time points and the  repetition number (e.g., "10-1", "10-2",
     "10-3", ...,  "20-1", "20-2", "20-3", etc.).

     'is.longitudinal' checks whether a matrix has the 'longitudinal'
     attributes.

     The functions 'summary', 'print', 'plot' are the standard generic
     functions adapted to 'longitudinal' objects.

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

     as.longitudinal(x, repeats=1, time)
     is.longitudinal(x)
     ## S3 method for class 'longitudinal':
     summary(object, ...)
     ## S3 method for class 'longitudinal':
     print(x, ...)
     ## S3 method for class 'longitudinal':
     plot(x, series=1, type=c("median", "mean"), autolayout=TRUE, ...)

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

x, object: Time series data, contained in a 'longitudinal' object or in
          matrix form ('as.longitudinal').

 repeats: Integer, or a vector of integers, that specifies the number
          of available measurements per time point.  If only one number
          is given then it is assumed the time series is regularly
          sampled. If instead a vector is specified, then each time
          point may have a different number of samples.

    time: A vector with the dates for the time points. If not
          specified, equally spaced time points  1, 2, 3, ... are
          assumed. 

  series: Number, or a vector of numbers, that indicates which time
          series (=variables and columns of x) are plotted.

    type: Determines whether the plotted line corresponds to the mean
          or median value of the samples per time point (default:
          "median").

autolayout: determine the number of columns and rows in the plot
          automatically in the display of multiple time series 
          (default: TRUE). 

     ...: Additional optional parameters

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

     'as.longitudinal' returns a 'longitudinal' object.

     'is.longitudinal' returns TRUE or false.

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

     Korbinian Strimmer (<URL: http://strimmerlab.org>).

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

     'longitudinal.util', 'tcell', 'ts'.

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

     # load "longitudinal" library
     library("longitudinal")

     # load data set
     data(tcell)
     is.longitudinal(tcell.34)
     attributes(tcell.34)
     tcell.34[,1:3]

     # how many samples and how many genes?
     dim(tcell.34)
     summary(tcell.34)

     # plot first nine time series
     plot(tcell.34, 1:9)

     #####

     # an artificial example with repeated measurements, irregular sampling, and unequal spacing 
     m <- matrix(rnorm(200), 50, 4)
     z <- as.longitudinal(m, repeats=c(10,5,5,10,20), time=c(2,8,9,15,16))
     plot(z, 1:4)

