Learn R Programming

functClust (version 0.1.6)

format_fclust: Format a raw dataset for a functional clustering

Description

Fit a raw dataset, then format it as n input for the function fclust.

Usage

format_fclust(dat, nbElt, weight = rep(1, dim(dat)[2] - nbElt - 1),
              opt.na = FALSE, opt.repeat = FALSE, opt.mean   )

Arguments

dat

a data.frame or matrix that brings together: a vector of assemblage identity, a matrix of occurrence of components within the system, one or more vectors of observed performances. Consequently, the data.frame or matrix dimensions are: dim(dat)[1]= the number of observed assemblages, * dim(dat)[2]= 1 + number of system components + number of observed performances. On a first line (colnames): assemblage identity, a list of components identified by their names, a list of performances identified by their names. On following lines (a line by assemblage), name of the assemblage (read as character), a sequence of 0 (absence) and 1 (presence of component within each assemblage) (this is the matrix of occurrence of components within the system), a sequence of numeric values for informed each observed performances (this is the set of observed performances).

nbElt

an integer, that specifies the number of components belonging to interactive system. nbElt is used to know the dimension of matrix of occurrence.

weight

a vector of numerics, that specifies the weight of each performance. By default, each performance is equally weighted. If weight is informed, it must have the same length as the number of observed performances.

opt.na

a logical. The records for each assemblage can have NA in matrix of occurrence or in observed assemblage performances. If opt.na = FALSE (by default), an error is returned. If opt.na = TRUE, the records with NA are ignored.

opt.repeat

a logical. in any case, the function looks for different assemblages with identical elemental composition. Messages indicate these identical assemblages. If opt.repeat = FALSE (by default), their performances are averaged. If opt.repeat = TRUE, nothing is done, and the data are processed as they are.

opt.mean

a character, equals to "amean" or "gmean". If opt.mean = "amean", means are computed using an arithmetic formula, if opt.mean = "gmean", mean are computed using a geometric formula.

Value

Return a list containing formatted inputs, that are:

  • fobs: the vector of observed performances of assemblages. names(fobs) contains the names of assemblages.

  • mOccur: the binary matrix of occurrence of components within the assemblages. dim(mOccur) = [nbAss, nbElt]. rownames(mOccur) contains the names of assemblages. colnames(mOccur) contains the names of components.

  • xpr: the vector of weight of different experiments. names(xpr) contains the names of different experiments.

Details

None.