R/nay.R

# nay (proportion at age)

## class
setClass("nay", contains="FLQuant")

setGeneric("nay", function(object, ...){
	standardGeneric("nay")
	}
)

setMethod("nay", signature("FLQuant"), function(object, ...){

	if(!missing(...)){
		object <- trim(object, ...)
	} else {
		object <- object
	}

	m <- apply(object@.Data,c(2:6),function(x){x/max(x, na.rm=TRUE)})
	nay <- object
	nay@.Data <- m
	dimnames(nay) <- dimnames(object)
	units(nay) <- "norm"
	new("nay", nay)

})

Try the FLEDA package in your browser

Any scripts or data that you put into this service are public.

FLEDA documentation built on May 2, 2019, 5:26 p.m.