Summarize the results of the simulation in data frames.

bioSum(obj, stknms = "all", years = dimnames(obj$biols[[1]]@n)$year,
  long = TRUE, scenario = "bc")

bioSumQ(obj, prob = c(0.95, 0.5, 0.05))

fltSum(obj, flnms = "all", years = dimnames(obj$biols[[1]]@n)$year,
  byyear = TRUE, long = TRUE, InterestRate = 0.03, scenario = "bc")

fltSumQ(obj, prob = c(0.95, 0.5, 0.05))

fltStkSum(obj, flnms = names(obj$fleets),
  stknms = catchNames(obj$fleets),
  years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE,
  long = TRUE, scenario = "bc")

fltStkSumQ(obj, prob = c(0.95, 0.5, 0.05))

mtStkSum(obj, flnms = names(obj$fleets),
  stknms = catchNames(obj$fleets),
  years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE,
  long = TRUE, scenario = "bc")

mtStkSumQ(obj, prob = c(0.95, 0.5, 0.05))

mtSum(obj, flnms = names(obj$fleets),
  years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE,
  long = TRUE, scenario = "bc")

mtSumQ(obj, prob = c(0.95, 0.5, 0.05))

advSum(obj, stknms = catchNames(obj$fleets),
  years = dimnames(obj$biols[[1]]@n)[[2]], long = TRUE,
  scenario = "bc")

advSumQ(obj, prob = c(0.95, 0.5, 0.05))

riskSum(obj, stknms = names(obj$biols), Bpa, Blim, Prflim,
  flnms = names(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]],
  scenario = "bc")

npv(obj, discF = 0.05, y0, flnms = names(obj$fleets),
  years = dimnames(obj$biols[[1]]@n)[[2]], scenario = "bc")

npvQ(obj, prob = c(0.05, 0.5, 0.95))

vesselSum(obj, flnms = "all", years = dimnames(obj$biols[[1]]@n)$year,
  byyear = TRUE, long = TRUE, scenario = "bc")

vesselSumQ(obj, prob = c(0.95, 0.5, 0.05))

vesselStkSum(obj, flnms = names(obj$fleets),
  stknms = catchNames(obj$fleets),
  years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE,
  long = TRUE, scenario = "bc")

vesselStkSumQ(obj, prob = c(0.95, 0.5, 0.05))

Arguments

obj

The output of the FLBEIA function.

stknms

Names of the stock for which the indicators will be calculated.

years

the names of the years for which the indicators will be calculated.

long

logical. The data frame should be constructed using long or wide format? Default TRUE.

scenario

a character string with the name of the scenario corresponding with obj. Default bc.

prob

a numeric vector with the probabilities used to calculate the quantiles.

flnms

Names of the fleet for which the indicators will be calculated.

byyear

logical. The indicators should be provided at season or year level? Default TRUE.

InterestRate

Capital oportunity cost rate.

Bpa

named numeric vector with one element per stock in stknms. The precautionary approach stock spawning biomass used in riskSum function to calculate biological risk yearly.

Blim

named numeric vector with one element per stock in stknms. The limit stock spawning biomass used in riskSum function to calculate biological risk yearly.

Prflim

named numeric vector with one element per fleet in flnms. The limit profit level used in riskSum function to calculate economic risk yearly.

discF

Discount rate.

y0

character. Reference year.

Value

A data frame with columns for scenario, year, stock, iter, indicator, value,...

The data frames can be of wide or long format. In long format all the indicators are in the same column. There is one column, indicator, for the name of the indicator and a second one value for the numeric value of the indicator. In the wide format each of the indicators correspond with one column in the data frame. The long format it is recommendable to work with ggplot2 functions for example while the wide format it is more efficient for memory allocation and speed of computations.

The quantile version of the summaries, fooQ, returns the quantiles of the indicators. In the long format as many columns as elements in prob are created. The name of the columns are the elements in prob preceded by a q. In the wide format for each of the indicators as many columns as elements in prob are created. The names of the colums are the elements in prob preceded by q_name_of_the_indicator.

Details

  • advSum, advSumQ: Data frame with the indicators related with the management advice (TAC). The indicators are: "catch", "discards", "discRat", "landings", "quotaUpt" and "tac".

  • bioSum, bioSumQ: Data frame with the biological indicators. The indicators are: "biomass", "catch", "catch.iyv", "discards", "disc.iyv", "f", "landings", "land.iyv", "rec" and "ssb".

  • fltSum, fltSumQ: Data frame with the indicators at fleet level. The indicators are: "capacity", "catch", "costs", "discards", "discRat", "effort", "fcosts", "gva", "grossValue", "landings", "fep", "nVessels", "price", "grossSurplus", "quotaUpt", "salaries", "vcosts" and "profitability".

  • fltStkSum, fltStkSumQ: Data frame with the indicators at fleet and stock level. The indicators are: "landings", "discards", "catch", "price", "quotaUpt", "tacshare", "discRat" and "quota".

  • npv: A data frame with the net present value per fleet over the selected range of years.

  • mtSum, mtSumQ: Data frame with the indicators at metier level. The indicators are: "effshare", "effort", "grossValue" and "vcost".

  • mtStkSum, mtStkSumQ: Data frame with the indicators at fleet and metier level. The indicators are: "catch", "discards", "discRat", "landings" and "price".

  • riskSum: A data frame with the risk indicators. The indicators are: "pBlim", "pBpa" and "pPrflim".

  • vesselSum, vesselSumQ: Data frame with the indicators at vessel level. The indicators are: "catch", "costs", "discards", "discRat", "effort", "fcosts", "gva", "grossValue", "landings", "fep", "price", "grossSurplus", "quotaUpt", "salaries", "vcosts" and "profitability".

  • vesselStkSum, vesselStkSumQ: Data frame with the indicators at vessel and stock level. The indicators are: "landings", "discards", "catch", "price", "quotaUpt", "tacshare", "discRat" and "quota".

  • summary_flbeia: An array with four dimensions: stock, year, iteration, indicator. The indicators are: recruitment, ssb, f, biomass, catch, landings and discards.

  • ecoSum_damara: ecoSum built in the framework of Damara project.

The data frames

Examples

# NOT RUN {
library(FLBEIA)

# Apply the summary functions to the examples runs in FLBEIA help page.
# Test the different arguments in summary function.

data(res_flbeia)
#------------------------------------------------
# Example One: One stock, one fleet, one iter.
#------------------------------------------------
oneRes_bio    <- bioSum(oneRes)
oneRes_flt    <- fltSum(oneRes)
oneRes_fltStk <- fltStkSum(oneRes)
oneRes_mt     <- mtSum(oneRes)
oneRes_mtStk  <- mtStkSum(oneRes)
oneRes_adv    <- advSum(oneRes)

head(oneRes_bio)
head(oneRes_flt)
head(oneRes_fltStk)
head(oneRes_mt)
head(oneRes_mtStk)
head(oneRes_adv)

oneRes_bioQ    <- bioSumQ(oneRes_bio)
oneRes_fltQ    <- fltSumQ(oneRes_flt)
oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk)
oneRes_mtQ     <- mtSumQ(oneRes_mt)
oneRes_mtStkQ  <- mtStkSumQ(oneRes_mtStk)
oneRes_advQ    <- advSumQ(oneRes_adv)

head(oneRes_bioQ)
head(oneRes_fltQ)
head(oneRes_fltStkQ)
head(oneRes_mtQ)
head(oneRes_mtStkQ)
head(oneRes_advQ)

# Wide format
oneRes_bio    <- bioSum(oneRes, long = FALSE, years = ac(2016:2020))
oneRes_flt    <- fltSum(oneRes, long = FALSE, years = ac(2016:2020))
oneRes_fltStk <- fltStkSum(oneRes, long = FALSE, years = ac(2016:2020))
oneRes_mt     <- mtSum(oneRes, long = FALSE, years = ac(2016:2020))
oneRes_mtStk  <- mtStkSum(oneRes, long = FALSE, years = ac(2016:2020))
oneRes_adv    <- advSum(oneRes, long = FALSE, years = ac(2016:2020))

head(oneRes_bio)
head(oneRes_flt)
head(oneRes_fltStk)
head(oneRes_mt)
head(oneRes_mtStk)
head(oneRes_adv)

oneRes_bioQ    <- bioSumQ(oneRes_bio)
oneRes_fltQ    <- fltSumQ(oneRes_flt)
oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk)
oneRes_mtQ     <- mtSumQ(oneRes_mt)
oneRes_mtStkQ  <- mtStkSumQ(oneRes_mtStk)
oneRes_advQ    <- advSumQ(oneRes_adv)

head(oneRes_bio)
head(oneRes_flt)
head(oneRes_fltStk)
head(oneRes_mt)
head(oneRes_mtStk)
head(oneRes_adv)

# Wide format with seasonal disaggregation. No seasonal disagregation available for 
# bio and adv summaries.

oneRes_bio    <- bioSum(oneRes, long = FALSE) # Biol summary is only by year.
oneRes_flt    <- fltSum(oneRes, long = FALSE, byyear = FALSE)
oneRes_fltStk <- fltStkSum(oneRes, long = FALSE, byyear = FALSE)
oneRes_mt     <- mtSum(oneRes, long = FALSE, byyear = FALSE)
oneRes_mtStk  <- mtStkSum(oneRes, long = FALSE, byyear = FALSE)
oneRes_adv    <- advSum(oneRes, long = FALSE) # Advice summary is only by year.

oneRes_bioQ    <- bioSumQ(oneRes_bio)
oneRes_fltQ    <- fltSumQ(oneRes_flt)
oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk)
oneRes_mtQ     <- mtSumQ(oneRes_mt)
oneRes_mtStkQ  <- mtStkSumQ(oneRes_mtStk)
oneRes_advQ    <- advSumQ(oneRes_adv)
oneRes_bio    <- bioSum(oneRes, long = TRUE) # Biol summary is only by year.
oneRes_flt    <- fltSum(oneRes, long = TRUE, byyear = FALSE)
oneRes_fltStk <- fltStkSum(oneRes, long = TRUE, byyear = FALSE)
oneRes_mt     <- mtSum(oneRes, long = TRUE, byyear = FALSE)
oneRes_mtStk  <- mtStkSum(oneRes, long = TRUE, byyear = FALSE)
oneRes_adv    <- advSum(oneRes, long = TRUE) # Advice summary is only by year.

oneRes_bioQ    <- bioSumQ(oneRes_bio)
oneRes_fltQ    <- fltSumQ(oneRes_flt)
oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk)
oneRes_mtQ     <- mtSumQ(oneRes_mt)
oneRes_mtStkQ  <- mtStkSumQ(oneRes_mtStk)
oneRes_advQ    <- advSumQ(oneRes_adv)


#------------------------------------------------
# Example OneIt: As one but with iterations.
#------------------------------------------------
oneItRes_bio    <- bioSum(oneItRes, scenario = 'with_iters')
oneItRes_flt    <- fltSum(oneItRes, scenario = 'with_iters')
oneItRes_fltStk <- fltStkSum(oneItRes, scenario = 'with_iters')
oneItRes_mt     <- mtSum(oneItRes, scenario = 'with_iters')
oneItRes_mtStk  <- mtStkSum(oneItRes, scenario = 'with_iters')
oneItRes_adv    <- advSum(oneItRes, scenario = 'with_iters')

oneItRes_bioQ    <- bioSumQ(oneItRes_bio)
oneItRes_fltQ    <- fltSumQ(oneItRes_flt)
oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk)
oneItRes_mtQ     <- mtSumQ(oneItRes_mt)
oneItRes_mtStkQ  <- mtStkSumQ(oneItRes_mtStk)
oneItRes_advQ    <- advSumQ(oneItRes_adv)

oneItRes_bio    <- bioSum(oneItRes, long = FALSE, years = ac(2016:2020))
oneItRes_flt    <- fltSum(oneItRes, long = FALSE, years = ac(2016:2020))
oneItRes_fltStk <- fltStkSum(oneItRes, long = FALSE, years = ac(2016:2020))
oneItRes_mt     <- mtSum(oneItRes, long = FALSE, years = ac(2016:2020))
oneItRes_mtStk  <- mtStkSum(oneItRes, long = FALSE, years = ac(2016:2020))
oneItRes_adv    <- advSum(oneItRes, long = FALSE, years = ac(2016:2020))


oneItRes_bioQ    <- bioSumQ(oneItRes_bio)
oneItRes_fltQ    <- fltSumQ(oneItRes_flt)
oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk)
oneItRes_mtQ     <- mtSumQ(oneItRes_mt)
oneItRes_mtStkQ  <- mtStkSumQ(oneItRes_mtStk)
oneItRes_advQ    <- advSumQ(oneItRes_adv)


oneItRes_bio    <- bioSum(oneItRes, long = FALSE) # Biol summary is only by year.
oneItRes_flt    <- fltSum(oneItRes, long = FALSE, byyear = FALSE)
oneItRes_fltStk <- fltStkSum(oneItRes, long = FALSE, byyear = FALSE)
oneItRes_mt     <- mtSum(oneItRes, long = FALSE, byyear = FALSE)
oneItRes_mtStk  <- mtStkSum(oneItRes, long = FALSE, byyear = FALSE)
oneItRes_adv    <- advSum(oneItRes, long = FALSE) # Advice summary is only by year.

oneItRes_bioQ    <- bioSumQ(oneItRes_bio)
oneItRes_fltQ    <- fltSumQ(oneItRes_flt)
oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk)
oneItRes_mtQ     <- mtSumQ(oneItRes_mt)
oneItRes_mtStkQ  <- mtStkSumQ(oneItRes_mtStk)
oneItRes_advQ    <- advSumQ(oneItRes_adv)


oneItRes_bio    <- bioSum(oneItRes, long = TRUE) # Biol summary is only by year.
oneItRes_flt    <- fltSum(oneItRes, long = TRUE, byyear = FALSE)
oneItRes_fltStk <- fltStkSum(oneItRes, long = TRUE, byyear = FALSE)
oneItRes_mt     <- mtSum(oneItRes, long = TRUE, byyear = FALSE)
oneItRes_mtStk  <- mtStkSum(oneItRes, long = TRUE, byyear = FALSE)
oneItRes_adv    <- advSum(oneItRes, long = TRUE) # Advice summary is only by year.

oneItRes_bioQ    <- bioSumQ(oneItRes_bio)
oneItRes_fltQ    <- fltSumQ(oneItRes_flt)
oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk)
oneItRes_mtQ     <- mtSumQ(oneItRes_mt)
oneItRes_mtStkQ  <- mtStkSumQ(oneItRes_mtStk)
oneItRes_advQ    <- advSumQ(oneItRes_adv)

oneItRes_risk <- riskSum( oneItRes, Bpa = c(stk1= 900), Blim = c(stk1 = 600),
                          Prflim = c(fl1 = 0), scenario = 'alternative')

oneItRes_npv  <- npv(oneItRes, y0 = '2014')

#------------------------------------------------
# Example Multi: Two stock, two fleet, four iters.
#------------------------------------------------
multiRes_bio    <- bioSum(multiRes)
multiRes_flt    <- fltSum(multiRes)
multiRes_fltStk <- fltStkSum(multiRes)
multiRes_mt     <- mtSum(multiRes)
multiRes_mtStk  <- mtStkSum(multiRes)
multiRes_adv    <- advSum(multiRes)

multiRes_bioQ    <- bioSumQ(multiRes_bio)
multiRes_fltQ    <- fltSumQ(multiRes_flt)
multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk)
multiRes_mtQ     <- mtSumQ(multiRes_mt)
multiRes_mtStkQ  <- mtStkSumQ(multiRes_mtStk)
multiRes_advQ    <- advSumQ(multiRes_adv)

multiRes_bio    <- bioSum(multiRes, long = FALSE, years = ac(2016:2020))
multiRes_flt    <- fltSum(multiRes, long = FALSE, years = ac(2016:2020))
multiRes_fltStk <- fltStkSum(multiRes, long = FALSE, years = ac(2016:2020))
multiRes_mt     <- mtSum(multiRes, long = FALSE, years = ac(2016:2020))
multiRes_mtStk  <- mtStkSum(multiRes, long = FALSE, years = ac(2016:2020))
multiRes_adv    <- advSum(multiRes, long = FALSE, years = ac(2016:2020))


multiRes_bioQ    <- bioSumQ(multiRes_bio)
multiRes_fltQ    <- fltSumQ(multiRes_flt)
multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk)
multiRes_mtQ     <- mtSumQ(multiRes_mt)
multiRes_mtStkQ  <- mtStkSumQ(multiRes_mtStk)
multiRes_advQ    <- advSumQ(multiRes_adv)


multiRes_bio    <- bioSum(multiRes, long = FALSE) # Biol summary is only by year.
multiRes_flt    <- fltSum(multiRes, long = FALSE, byyear = FALSE)
multiRes_fltStk <- fltStkSum(multiRes, long = FALSE, byyear = FALSE)
multiRes_mt     <- mtSum(multiRes, long = FALSE, byyear = FALSE)
multiRes_mtStk  <- mtStkSum(multiRes, long = FALSE, byyear = FALSE)
multiRes_adv    <- advSum(multiRes, long = FALSE) # Advice summary is only by year.

multiRes_bioQ    <- bioSumQ(multiRes_bio)
multiRes_fltQ    <- fltSumQ(multiRes_flt)
multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk)
multiRes_mtQ     <- mtSumQ(multiRes_mt)
multiRes_mtStkQ  <- mtStkSumQ(multiRes_mtStk)
multiRes_advQ    <- advSumQ(multiRes_adv)


multiRes_bio    <- bioSum(multiRes, long = TRUE) # Biol summary is only by year.
multiRes_flt    <- fltSum(multiRes, long = TRUE, byyear = FALSE)
multiRes_fltStk <- fltStkSum(multiRes, long = TRUE, byyear = FALSE)
multiRes_mt     <- mtSum(multiRes, long = TRUE, byyear = FALSE)
multiRes_mtStk  <- mtStkSum(multiRes, long = TRUE, byyear = FALSE)
multiRes_adv    <- advSum(multiRes, long = TRUE) # Advice summary is only by year.

multiRes_bioQ    <- bioSumQ(multiRes_bio)
multiRes_fltQ    <- fltSumQ(multiRes_flt)
multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk)
multiRes_mtQ     <- mtSumQ(multiRes_mt)
multiRes_mtStkQ  <- mtStkSumQ(multiRes_mtStk)
multiRes_advQ    <- advSumQ(multiRes_adv)

multiRes_npv  <- npv(multiRes, y0 = '2014')
risk_multiRes <- riskSum( multiRes, Bpa = c(stk1= 135000, stk2 = 124000),
                          Blim = c(stk1= 96000, stk2 = 89000), Prflim = c(fl1 = 0, fl2 = 0),
                          scenario = 'alternative')

# }