Skip to content

Commit

Permalink
Avoid conflict between function t() and parameter t
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavdelius committed Jul 27, 2020
1 parent 6ff870c commit 99f12bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/project_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ mizerEncounter <- function(params, n, n_pp, n_other, t, ...) {
# mvfft() does a Fourier transform of each column of its argument, but
# we need the Fourier transforms of each row, so we need to apply mvfft()
# to the transposed matrices and then transpose again at the end.
avail_energy <- Re(t(mvfft(t(params@ft_pred_kernel_e) * mvfft(t(prey)),
avail_energy <- Re(base::t(mvfft(base::t(params@ft_pred_kernel_e) *
mvfft(base::t(prey)),
inverse = TRUE))) / length(params@w_full)
# Only keep the bit for fish sizes
avail_energy <- avail_energy[, idx_sp, drop = FALSE]
Expand Down Expand Up @@ -452,7 +453,7 @@ mizerPredRate <- function(params, n, n_pp, n_other, t, feeding_level, ...) {
mizerPredMort <- function(params, n, n_pp, n_other, t, pred_rate, ...) {
idx_sp <- (length(params@w_full) -
length(params@w) + 1):length(params@w_full)
return((t(params@interaction) %*% pred_rate)[, idx_sp, drop = FALSE])
return((base::t(params@interaction) %*% pred_rate)[, idx_sp, drop = FALSE])
}

#' Get predation mortality rate for resource needed to project standard mizer
Expand Down

0 comments on commit 99f12bf

Please sign in to comment.