ReportTable: Create a basic exportable table from historic estimates,...

View source: R/plots.R

ReportTableR Documentation

Create a basic exportable table from historic estimates, including n-year average

Description

ReportTable will summarize historic estimates from in an .html table that can be exported for reporting.

Usage

ReportTable(
  data,
  species,
  year,
  index = "none",
  yr.avg,
  cap = "none",
  new.names = "none",
  missing = NULL
)

Arguments

data

The estimates object. Must be in a format with Year, Species, index, and index variance if not one of the included package data objects (ACPHistoric, CRDHistoric, YKDHistoric, YKDVHistoric, or YKGHistoric).

species

The species chosen (see sppntable for options). Currently supports no more than 1 species.

year

The range of years for the table.

index

The column names that specify the index estimate and its variance. Must be ordered correctly (index, variance) or (index1, variance1, index2, variance2). Currently up to 2 indices are supported. If no index is specified, the user will be prompted with choices from the data.

yr.avg

The number of years in the n-year running average requested.

cap

The overall table caption. If nothing entered as an argument, the user will be prompted to enter a caption in the function.

new.names

The desired column names for the final table. If these are not specified the user will be prompted to input within the function.

missing

Any missing years of data to be displayed as NA

Details

ReportTable will take one of the historic estimates tables (package data for AKaerial) and display it as an .html table object suitable for an external report. The user can specify n for an n-year average if one is desired. A similarly structured data frame could be used in place of one of the historic estimates tables, provided it has columns for Year, Species, an index, and that index variance. Table caption and column headings can either be specified as arguments or entered by the user once the table is created

Value

Renders an .html table and also returns it in data frame format

Author(s)

Charles Frost, charles_frost@fws.gov

References

https://github.com/USFWS/AKaerial

Examples

ReportTable(data=ACPHistoric$combined, species="SPEI", year = c(2007:2019), index = c("total", "total.var"), yr.avg=3, cap="Test table!", new.names=c("Year", "Total Birds", "SE", "3-year Avg", "SE"))


USFWS/AKaerial documentation built on April 3, 2025, 4:06 p.m.