From 518627b0c71e213bc8598a92670248d13815bc92 Mon Sep 17 00:00:00 2001 From: Laura Wise Date: Thu, 8 Sep 2022 15:07:51 +0100 Subject: [PATCH] Fix advSum function Change landings from factor to numeric. Removed duplicated code --- R/Results_Summary.R | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/R/Results_Summary.R b/R/Results_Summary.R index a81e532..d1d452e 100644 --- a/R/Results_Summary.R +++ b/R/Results_Summary.R @@ -1742,16 +1742,9 @@ advSum <- function(obj, stknms = 'all', years = dimnames(obj$biols[[1]]@n)$year, # character numeric numeric character numeric res <- res %>% mutate( year = as.numeric(as.character(year)), - iter = as.numeric(as.character(iter))) - - # Set consistent classess in summary outputs - # lapply(res, class) - # "stock" "year" "iter" "catch":"discRat" - # character numeric numeric numeric - - res <- res %>% mutate( year = as.numeric(year), - iter = as.numeric(as.character(iter))) - + iter = as.numeric(as.character(iter)), + landings = as.numeric(as.character(landings))) + # reshaping this to the long format if(long == TRUE) res <- res %>% gather(key='indicator', value='value', .data$catch, .data$discards, .data$discRat, .data$landings, .data$quotaUpt, .data$tac)