standardUnits | R Documentation |
Returns values for the units of each FLQuant slot according to the standard adopted by the FLR Team for the supplied class.
standardUnits(object, ...)
## S4 method for signature 'character'
standardUnits(object, ...)
## S4 method for signature 'FLS'
standardUnits(object, ...)
## S4 method for signature 'FLBiol'
standardUnits(object, ...)
object |
for which the standard units are to be returned |
For objects derived from class FLS, which currently includes FLStock and FLStockLen, the adopted standard includes: 'kg' for individual weights, '1000' for number of individuals, 't' for biomass, 'f' for harvest, 'm' for natural mortality, and an empty string for proportions (spwn, mat).
For objects derived of class FLBiol the adopted standard units are: 'kg' for individual weights, '1000' for number of individuals, 'm' for natural mortality, and an empty string for proportions (spwn, mat).
A list with the corresponding units value for each slot
The FLR Team
units-FLCore
stk <- FLStock(catch=FLQuant(runif(20, 2, 120)))
# FLStock object has no units
summary(stk)
# Obtain standard units for the class as a list
standardUnits(stk)
# which can then be assigned to the object
units(stk) <- standardUnits(stk)
summary(stk)
# units<- methjod also accepts a function to be called to provide units
units(stk) <- standardUnits
bio <- FLBiol(n=FLQuant(runif(50, 2, 120), dim=c(5, 10)))
# Object has no units
summary(bio)
# Obtain standard units for the class as a list
standardUnits(bio)
# which can then be assigned to the object
units(bio) <- standardUnits(bio)
summary(stk)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.