-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
It would be convenient if predict.ALKmodel somehow indicated the length classes and possibly also age classes for the matrix it returns. I thought it might be related to an attribute of the data (e.g. attr(dat, "cm.breaks")), but it isn't transparent to me. In the following example, it would be nice if the rownames and colnames were assigned by the predict.ALKmodel function. The length classes (11:109) differ from cm.breaks (5:115)
Edit: Sorry, cm.breaks are 10:115 for this quarter. They were 5:115 if I look at quarters 1 and 3.
library(DATRAS)
#Get data from DATRAS
dat_all_spp = getDatrasExchange("NS-IBTS", years = 2021, quarters = 1)
#Subset to only look at Atlantic cod
dat0 = subset(dat_all_spp, Species=="Gadus morhua")
#Define how wide the length categories should be
dat = addSpectrum(dat0, by=1)
attr(dat, "cm.breaks")
#Fit age-length keys to multiple ages with one funciton
alk = fitALK(dat, minAge=1, maxAge=6)
#Plot the model predictions
plotALKfit(alk, row=1)
#Plot the observations with the predictions
plotALKraw(dat, minAge=1, maxAge=6, add=TRUE)
ALKprobs = predict(alk, type="ALK")[[1]]
rownames(ALKprobs) = 11:109
colnames(ALKprobs)=1:6
Metadata
Metadata
Assignees
Labels
No labels