Skip to content

Commit

Permalink
Comment on w_inf no longer leads to error in plyr::aaply(). Closes #269
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavdelius committed Dec 5, 2022
1 parent 7a684ed commit 1d56040
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions R/MizerParams-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,7 @@ emptyParams <- function(species_params,
dimnames = list(sp = species_names, w = signif(w,3)))
ft_pred_kernel <- array(NA, dim = c(no_sp, no_w_full),
dimnames = list(sp = species_names, k = 1:no_w_full))
ft_mask <- plyr::aaply(species_params$w_inf, 1,
function(x) w_full < x, .drop = FALSE)
ft_mask <- t(sapply(species_params$w_inf, function(x) w_full < x))

selectivity <- array(0, dim = c(length(gear_names), no_sp, no_w),
dimnames = list(gear = gear_names, sp = species_names,
Expand Down
4 changes: 2 additions & 2 deletions R/summary_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ get_size_range_array <- function(params, min_w = min(params@w),
value for each species.")
}
if (!all(min_w < max_w)) stop("min_w must be less than max_w")
min_n <- plyr::aaply(min_w, 1, function(x) params@w >= x, .drop = FALSE)
max_n <- plyr::aaply(max_w, 1, function(x) params@w <= x, .drop = FALSE)
min_n <- t(sapply(min_w, function(x) params@w >= x))
max_n <- t(sapply(max_w, function(x) params@w <= x))
size_n <- min_n & max_n
dimnames(size_n) <- list(sp = params@species_params$species,
w = signif(params@w, 3))
Expand Down
Binary file removed data/NS_params.RData
Binary file not shown.
Binary file added data/NS_params.rda
Binary file not shown.

0 comments on commit 1d56040

Please sign in to comment.