FLQuant {FLCore}R Documentation

FLQuant

Description

Creates a new FLQuant

Usage

   FLQuant(object, dimnames = "missing", dim = "missing", quant = NULL, units = "NA")

Arguments

object A vector, matrix, array or FLQuant to be used when creating the FLQuant.
dimnames A list specifying the dimnames of the FLQuant.
dim Dimensions of the FLQuant, if object is not a 5 dimensional array or FLQuant.
quant The name of the first dimension. A character string. Defaults to "quant".
units A character with the measurement units of the data. Defaults to "NA" (Don't mistake with NA).

Details

FLQuant() is the basic creator function for object of class FLQuant. The function accepts objects of various classes as input, and its behaviour adapts to them, as well as to the values specified for dim and dimnames

missing
If no input object is given, an empty FLQuant is returned, with dimensions set by dim and dimension names equal to dimnames, if given.
vector
Vectors, including those of length one, are assumed to represent time series along the year dimension. If dim or dimnames are specified, they are used to set the final dimensions of the FLQuant object. If the second dimension given differs from the length of the input vector, the later is reused. If both dim and dimnames are given, their dimensions must match.
matrix or array
Matrices in R are simply 2-D arrays. If the input array has less than five dimensions, it is assumed the missing ones are of length one.

The name of the first dimension can be specified using the quant input variable. But if dimnames are specified, the quant name is taken from the first item on the dimnames list.

Value

FLQuant returns an FLQuant object with the specified data, dimensions, dimension names, quant and units.

Author(s)

FLR Team

See Also

FLQuant-class, units, quant

Examples

# Generate an array containing random numbers, and convert it into an FLQuant
sq <- FLQuant(array(rnorm(120, mean=2), dim=c(20,3,2,1,1),
      dimnames=list(age=as.character(1:20), 
                    year=c("1999", "2000", "2001"), 
                    unit=c("male", "female"), 
                    season="all", area="all")), units="Tons")

[Package FLCore version 1.4-4 Index]