

   CCrreeaattee aa ggrroouuppeeddDDaattaa oobbjjeecctt ffrroomm aa mmaattrriixx

        balancedGrouped(form, data, labels=NULL, units=NULL)

   AArrgguummeennttss::

       form: A formula of the form `y ~ x | g' giving the name
             of the response, the primary covariate, and the
             grouping factor.

       data: A matrix or data frame containing the values of
             the response grouped according to the levels of
             the grouping factor (rows) and the distinct levels
             of the primary covariate (columns).  The `dim-
             names' of the matrix are used to construct the
             levels of the grouping factor and the primary
             covariate.

     labels: an optional list of character strings giving
             labels for the response and the primary covariate.
             The label for the primary covariate is named `x'
             and that for the response is named `y'.  Either
             label can be omitted.

      units: an optional list of character strings giving the
             units for the response and the primary covariate.
             The units string for the primary covariate is
             named `x' and that for the response is named `y'.
             Either units string can be omitted.

   DDeessccrriippttiioonn::

        Create a `groupedData' object from a data matrix.  This
        function can only be used with balanced grouped data
        that will be representable as a matrix.  The opposite
        conversion (`groupedData' to `matrix') is performed by
        `asTable'.

   VVaalluuee::

        A balanced `groupedData' object.

   AAuutthhoorr((ss))::

        Jose Pinheiro and Douglas Bates

   SSeeee AAllssoo::

        `groupedData', `isBalanced', `asTable'

   EExxaammpplleess::

        library(lme)
        data(Orthodont)
        OrthoMat <- asTable( Orthodont )
        Orth2 <- balancedGrouped(distance ~ age | Subject, data = OrthoMat,
            labels = list(x = "Age",
                          y = "Distance from pituitary to pterygomaxillary fissure"),
            units = list(x = "(yr)", y = "(mm)"))
        Orth2[ 1:10, ]        ## check the first few entries

