dims | R Documentation |
List with information on object dimensions
List with information on object dimensions
dims(obj, ...)
dims(obj, ...)
## S4 method for signature 'FLQuant'
dims(obj, element, ...)
Method dims
returns a named list with information on the dimensions
and dimension names of a given object. The list returned could be
extended in the future and currently contains, depending on the class of the
object, some of the following:
Length of the first dimension
First quant
Last quant
Number of years
First year in series
Last year in series
Number of cohorts
First cohort in series
Last cohort in series
Length of the third (unit
) dimension
Length of the fourth (season
) dimension
Length of the fifth (area
) dimension
Length of the sixth (iter
) dimension
Values in the returned list are of class numeric
, unless dimnames are
strings with no numeric translation, in which case the result is NA
.
Please note that the name of the first element in the returned list changes
with the name of the first dimension in the input object. Use
quant
to obtain the name and extract the relevant element from
the result list.
Method dims
returns a named list with information on the dimensions
and dimension names of a given object. The list returned could be
extended in the future and currently contains, depending on the class of the
object, some of the following:
Length of the first dimension
First quant
Last quant
Number of years
First year in series
Last year in series
Number of cohorts
First cohort in series
Last cohort in series
Length of the third (unit
) dimension
Length of the fourth (season
) dimension
Length of the fifth (area
) dimension
Length of the sixth (iter
) dimension
Values in the returned list are of class numeric
, unless dimnames are
strings with no numeric translation, in which case the result is NA
.
Please note that the name of the first element in the returned list changes
with the name of the first dimension in the input object. Use
quant
to obtain the name and extract the relevant element from
the result list.
dims(obj)
dims(obj)
The FLR Team
dimnames
, FLQuant
dimnames
, FLQuant
flq <- FLQuant(rnorm(96), dim=c(3,8,1,4), quant='age')
dims(flq)
# Number of seasons
dims(flq)$season
# Length of first dimension
dims(flq)[[quant(flq)]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.