FLQuant {FLCore} | R Documentation |
FLQuant is the basic structure for age, time, and area structured fisheries information in the FLR library. Its basic structure is a five-dimensional array, with named dimensions and an 'units' attribute to store the measurement units of the data.
The name of the first dimension of an FLQuant is not set, and can be altered by the user. This is meant to reflect the first dimension the data is structured along. This could be age, length, vesselclass,... Any character string is accepted, but it should contain no spaces. When not set it is usually refered to as the quant of the FLQuant. The other four dimensions of an FLQuant are, in this order, year, unit, season, and area. The first one needs no explanation, the second is open to any sort of division that might be of use, like male/female or substocks. The last two allow for space and time subdivisions. Dimensions names are always of class character, even if they represent numeric values.
Together with the data, FLQuants have an extra attribute, called units This is a character string to store information about the units of measurement of the data. Do not confuse it with the unit dimension. Users are allowed to use any name, but standard ones are encouraged as they allow for clear interpretation.
Objects are usually created by calls to the constructor function
FLQuant
. They also can be created by calls of the form
new("FLQuant", ...)
.
.Data
:array
with dimensions named quant
,
year
, unit
, season
and area
. Note that the unit
dimension can be used to separate quantities by sex, by spawning status, ...units
:"character"
representing the units of
magnitude of the data. Presently any character string is accepted, but users are
encouraged to use standard acronyms, such as "t" for metric tonnes, "kg" for kilograms,
and "1", "1e3", "1e6",... for individuals, thousands and millions of individuals
respectively.
Class "array"
.
The generator function is FLQuant
.
units
slot. See units
Altering objects:
units
slot. See units
Indexing and subsetting:
signature(obj = "FLQuant")
trim
}
Graphic output:
Object coercion:
units
is added as an attribute.FLR Team
FLQuant
units
,
quant
,
is.FLQuant
,
as.FLQuant
# 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") summary(sq) show(sq) dims(sq) names(sq) sq <- sq[1:12,,1]