getFleetG: getFleetG - Compute all-site (fleetwide) Evidence of Absence...

Description Usage Arguments Details Value Examples

View source: R/getFleetG.R

Description

Compute a single all-site g value from site-season specifice g values.

Usage

1
2
getFleetG(siteYearResults, species = "LBBA", weights = NULL,
  yearWeights = NULL)

Arguments

siteYearResults

A data frame containing site-season results. One usually obtains this by running the site-year module of the eoa package on every combination of year and site. To assist with this, we at WEST have a python app which copies and pastes the input parameters from CSV files into the interface of eoa. Once site-year g-values are computed (using the auto-copy-paste routine), we have a "scraper" function in R which pulls parameters from all the text files that eoa produces. This parameter is a data frame containing the output CSV results from the "scraper". At a minimum, siteYearResults must contain the following columns: $species, $facility, $gFac.a = the alpha paramters of this facility's beta distribution, $gFac.b = the beta parameter of this facility's beta distribution, and $year.

species

Species abbreviation to run.

weights

A scalar or data frame containing weights for each facility in the fleet. One row per facility. This is the "DWP" field of eoa. If weights = NULL, all facilities receive equal weight. Otherwise, weights must be a data frame containing $facility and $weight columns. This is merged with siteYearResults using $facility as the key. These weights are re-scaled to sum to 1.0 in the mixtureBeta function.

yearWeights

When more than one year at a facility is present, this parameter allows different weights to be applied across years. The length of this vector must be equal to the number of years of data for all facilities that have multiple years of data. That is, an individual facility can have either 1 or length(yearWeights) rows in siteYearResults. If yearWeights == NULL, equal weights are use. These weights are re-scaled to sum to 1.0 inside the mixtureBeta function.

Details

Seasons are summarized first. That is, if a site appears more than once for a species, we assume each line is a separate season for that species. g is averaged over those lines first. At the end, this average goes into the multi-site g average.

Value

The fleet-wide g-value for a particular species. This value can then go into estimateL.eoa.

Examples

1
2
3
4
5
6
syr <- data.frame(species=c("LBBA","LBBA","LBBA"),
   facility=c("f1","f2","f2"),
   gFac.a = c( 69.9299, 63.5035,  84.6997),
   gFac.b = c(  736.4795,  318.3179, 759.9333 ),
   year = c(2015,2015,2016))
getFleetG(syr, "LBBA")

tmcd82070/evoab documentation built on May 13, 2020, 11:25 p.m.