Skip to content

Commit

Permalink
Bug in Arith FLArray/FLPar, thanks TB
Browse files Browse the repository at this point in the history
  • Loading branch information
iagomosqueira committed Apr 12, 2024
1 parent 1077adb commit 5ceb239
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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.9010
Version: 2.6.20.9100
Authors@R: c(
person("Iago", "Mosqueira", email = "iago.mosqueira@wur.nl",
role = "cre", comment=c(c(ORCID = "0000-0002-3252-0591"))),
Expand Down
11 changes: 11 additions & 0 deletions R/FLPar.R
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,14 @@ setMethod("Arith", ## "+", "-", "*", "^", "%%", "%/%", "/"
#' @examples
#' # FLQuant and FLPar
#' flq / flp

setMethod("Arith", signature(e1 = "FLArray", e2 = "FLPar"),
function(e1, e2) {

# BUG: USING %op%
op <- as.character(get('.Generic'))
return(do.call(paste0("%", op, "%"), list(e1, e2)))

# objects dims
d1 <- dim(e1)
d2 <- dim(e2)
Expand Down Expand Up @@ -570,6 +576,11 @@ setMethod("Arith", signature(e1 = "FLArray", e2 = "FLPar"),
#' @rdname Arith-methods
setMethod("Arith", signature(e1 = "FLPar", e2 = "FLArray"),
function(e1, e2) {

# BUG: USING %op%
op <- as.character(get('.Generic'))
return(do.call(paste0("%", op, "%"), list(e1, e2)))

# objects dims
d1 <- dim(e1)
d2 <- dim(e2)
Expand Down

0 comments on commit 5ceb239

Please sign in to comment.