Skip to content

Commit

Permalink
Removed iterMedians(FLStock), bad idea, added it for FLQuants
Browse files Browse the repository at this point in the history
  • Loading branch information
iagomosqueira committed Dec 6, 2024
1 parent e926887 commit 6a25ac2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 30 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.20.9309
Version: 2.6.20.9310
Authors@R: c(
person("Iago", "Mosqueira", email = "iago.mosqueira@wur.nl",
role = "cre", comment=c(c(ORCID = "0000-0002-3252-0591"))),
Expand Down
10 changes: 10 additions & 0 deletions R/FLQuants.R
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,13 @@ setMethod("merge", signature(x="FLQuants", y="FLQuants"),
)

# }}}

# iterMedians {{{
setMethod("iterMedians", signature(x="FLQuants"),
function(x) {

res <- lapply(x, iterMedians)

return(res)
})
# }}}
4 changes: 2 additions & 2 deletions R/FLS.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#' computeLandings,FLStockLen-method
setMethod("computeLandings", signature(object="FLS"),
function(object, na.rm=TRUE) {
res <- quantSums(landings.n(object) * landings.wt(object), na.rm=na.rm)
return(res)
res <- quantSums(landings.n(object) * landings.wt(object), na.rm=na.rm)
return(res)
}
) # }}}

Expand Down
15 changes: 0 additions & 15 deletions R/FLStock.R
Original file line number Diff line number Diff line change
Expand Up @@ -2350,21 +2350,6 @@ setMethod("ageopt", signature(object="FLStock"),
)
# }}}

# iterMedians {{{
setMethod("iterMedians", signature(x="FLStock"),
function(x) {

res <- qapply(x, iterMedians)

landings(res) <- iterMedians(landings(x))
discards(res) <- iterMedians(discards(x))
catch(res) <- iterMedians(catch(x))
stock(res) <- iterMedians(stock(x))

return(res)
})
# }}}

# update(FLStock, ...) {{{

setMethod("update", signature(object="FLStock"),
Expand Down
12 changes: 0 additions & 12 deletions R/FLStockR.R
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,6 @@ setAs('FLStockR', 'FLStock',
})
# }}}

# iterMedians {{{
setMethod("iterMedians", signature(x="FLStockR"),
function(x) {

res <- callNextMethod()

refpts(res) <- iterMedians(refpts(x))

return(res)
})
# }}}

# depletion {{{

setMethod("depletion", signature(x="FLStockR"),
Expand Down

0 comments on commit 6a25ac2

Please sign in to comment.