Skip to content

Commit

Permalink
invALK can now use FLife::vonB
Browse files Browse the repository at this point in the history
  • Loading branch information
iagomosqueira committed Jan 11, 2024
1 parent 9ba6652 commit 93f94d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: FLCore
Title: Core Package of FLR, Fisheries Modelling in R
Version: 2.6.19.9104
Version: 2.6.19.9105
Authors@R: c(
person("Iago", "Mosqueira", email = "iago.mosqueira@wur.nl",
role = "cre", comment=c(c(ORCID = "0000-0002-3252-0591"))),
Expand Down
1 change: 1 addition & 0 deletions R/FLS.R
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ setMethod("dbind", signature(x="FLS", y="FLS"),
res <- lapply(setNames(nm=names(fqs[[1]])), function(i)
do.call(dbind, c(lapply(fqs, '[[', i), dim=dim)))

# BUILD new object
out <- do.call(class(x), res)

# ASSIGN names
Expand Down
12 changes: 9 additions & 3 deletions R/length.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ invALK <- function(params, model=vonbert, age, cv=0.1, lmax=1.2, bin=1,

# FOR each age
bins <- seq(0, ceiling(linf * lmax), bin)
lparams <- as(FLPar(params), "list")
len <- do.call(model, c(list(age=age),
lparams[names(lparams) %in% names(formals(model))]))

# METHOD
if(isS4(model))
len <- do.call(model, list(age=age,params=params))
else {
lparams <- as(FLPar(params), "list")
len <- do.call(model, c(list(age=age),
lparams[names(lparams) %in% names(formals(model))]))
}

if(is.null(reflen)) {
sd <- abs(len * cv)
Expand Down

0 comments on commit 93f94d0

Please sign in to comment.