FLQuant {FLCore} | R Documentation |
Creates a new FLQuant
FLQuant(object, dimnames = "missing", dim = "missing", quant = NULL, units = "NA")
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 ). |
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
dim
and dimension names equal to dimnames
, if given.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.
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.
FLQuant
returns an FLQuant
object with the specified data, dimensions,
dimension names, quant and units.
FLR Team
# 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")