Learn R Programming

⚠️There's a newer version (1.4.9) of this package.Take me there.

GenEst

GenEst: Generalized Fatality Estimator

GenEst is a tool for estimating mortalities from efficiency, persistence, and carcass data.

DISCLAIMER

This software is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The software has not received final approval by the U.S. Geological Survey (USGS). No warranty, expressed or implied, is made by the USGS or the U.S. Government as to the functionality of the software and related material nor shall the fact of release constitute any such warranty. The software is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the software.

Installation

Setup and installation require several steps. Do not skip any steps.

Updated version of R (>= 3.5.0, released on 23 April 2018):

R is free and open source software for statistical computing. If R is not installed on your computer or if your version of R is <3.5.0, download and install the latest version from https://cran.r-project.org/, following the instructions provided at the site. In particular, "Download" and then "install R for the first time" (if working in Windows), or "Download" and then follow the further instructions on the subsequent web page (if working on Mac OS or Linux-like OS). If you already have an older copy of R installed on your computer, the new version will be installed alongside the old. Unless you know a reason why you want to keep both versions, it is usually a good idea to uninstall the old version to avoid confusion and clutter.

NOTE TO EXPERIENCED R USERS: When you install a new version of R, packages that you previously installed under an older version may not be immediately available to the new R. If not, the easiest way to make them available is to copy the package folders in your old "library" folder into the "library" folder in your new R installation. Then, enter update.packages() in R. If asked about a CRAN mirror, choose the nearest location. If you are working in Windows OS and are asked whether you want to install packages "from source", choose "No".

Third-party packages:

Several third-party pacakges are required; all are free and open source and available from CRAN. The easiest way to install them is to run the following commands in R (with guidance concerning potential dialog boxes given below the commands):


package_req <- c("corpus", "DT", "gsl", "gtools", "htmltools", "htmlwidgets", "lubridate", "MASS", "matrixStats", "mvtnorm", "Rcpp", "shiny", "shinyjs",  "survival")
package_new <- package_req[!(package_req %in% installed.packages()[,"Package"])] 
if(length(package_new) > 0) install.packages(package_new)
if (packageVersion("htmlwidgets") < "1.5") install.packages("htmltools")
if (packageVersion("shiny") < "1.4.0") install.packages("shiny")

-- If asked about a "CRAN mirror", choose the nearest location.

-- If asked whether you want to use a "personal library", choose "Yes"

-- If you are on Windows and are asked whether you want to install packages and their dependencies "from source", choose "No" (unless you are ready to go to lunch, in which case, you can select "Yes" and the installation may well be done by the time you get back).

GenEst:

Click on "Tags" under the "Repository" tab on the left sidebar at https://code.usgs.gov/ecosystems/GenEst and then click the link for the specific release you want.

-- For Windows, download the compressed folder GenEst_1.x.x.zip (do not unzip) and note where it is stored. You will install from the local .zip folder.

-- For Mac OS or Unix-like OS, download the compressed file GenEst_1.x.x.tar.gz and note where it is stored. You will install from the local .tar.gz file.

If you are working directly in R (not R Studio), run the following command:

install.packages(file.choose()) # and navigate to the package archive file you just downloaded: GenEst_1.x.x.xxx

If you are working in R Studio:

Click "Install" in the Packages pane.

Select "Package Archive File (.zip; .tar.gz)" as "Install from:" in the dialog box.

Browse to where you saved the zip file, and open it so it appears in the "Package archive" space.

Click the Install button on the dialog box.

Getting Started

Graphical user interface (GUI): easy-to-use buttons and menus

To start the GUI, open R and enter the command:

library(GenEst)
runGenEst()

Download the User Guide from a link near the bottom of the "Help" page in the app or from https://pubs.usgs.gov/tm/7c19/tm7c19.pdf

R command line: more functionality and flexibility

library(GenEst)
browseVignettes("GenEst")
?GenEst

Also, help files for GenEst functions are accessible in the standard R way, for example:

?pkm

Further Reading

GenEst User Guide: https://doi.org/10.3133/tm7C19

GenEst Statistical Models: https://doi.org/10.3133/tm7A2

Copy Link

Version

Install

install.packages('GenEst')

Monthly Downloads

381

Version

1.4.8

License

CC0

Maintainer

Daniel Dalthorp

Last Published

November 23rd, 2022

Functions in GenEst (1.4.8)

CPdistOptions

Produce the options for the distributions in the CP model
DWPCols

Select the DWP-ok columns from a data table
aicc.pkmSetSize

Create the AICc tables for a list of sets of searcher efficiency models
SEsi_right

Calculate conditional probability of observation after a series of searches
aicc.pkmSet

Create the AICc tables for a set of searcher efficiency models
aicc.cpmSetSize

Create the AICc tables for a list of sets of searcher efficiency models
aicc.pkm

extract AICc value from pkm object
aicc

Generic S3 function for summarizing AICc
aicc.cpm

Extract AIC and AICc for a carcass persistence model
SEsi

Calculate decayed searcher efficiency
SEpanel

Produce a single panel in an SE summary/diagnostic plot
aicc.cpmSet

Create the AICc tables for a set of carcass persistence models
app_output_utilities

app utilities for formatting text, tables, figs, etc. for display
app_download_functions

GenEst app download funtions
app_msg_functions

GenEst App Messages
app_panels

app panel utility functions
SEsi0

Calculate decayed searcher efficiency for a single pk
app_utilities

app utilities
SEsi_left

Calculate conditional probability of observation at a search
app_ui_utilities

HTML parameters
app_server

The GenEst server definition function
checkSpecificModelCP

Error check a specific model selection for a CP plot
checkSpecificModelSE

Error check a specific model selection for an SE plot
calcTsplit

Estimate the number of fatalities by time interval
app_ui

Create the GenEst User Interface HTML
app_widgets

Create and manage widgets for data input, function execution, data output
averageSS

Tabulate an average search schedule from a multi-unit SS data table
calcg

Calculate detection probability for given SE and CP parameters and search schedule.
cpm

Fit cp carcass persistence models
cpmFail

Check if a CP model is well-fit
aicc.pkmSize

Create the AICc tables for a list of sets of searcher efficiency models
app_content

GenEst Information
checkComponents

Check for model components
checkDate

Checks whether a vector of data can be interpreted as dates
countCarcs

Count the minimum number of carcasses in the cells
cpLogLik

Calculate the negative log-likelihood of a carcass persistence model
cpmSetFail

Check if cpm models fail
cpmSetSizeFail

Check if all of the cpm models fail
estM

Estimate mortality
cpmSetFailRemove

Remove failed cpm models from a cpmSet object
obsCols_fta

Select the columns from a data table that could be CP First Time Absent observations
defineUnitCol

Auto-parsing to find the name of the unit column (unitCol) If a unit column is not explicitly defined by user in the arg list to estM or estg, then defineUnitCol parses the CO, DWP, and SS files to extract the unit column if possible. Criteria that a column must meet to be a unit column are that it is found in both data_CO and data_DWP, all units in data_CO must also be included among units in data_DWP, all units in both data_CO and data_DWP must be included among the column names in data_SS. If data_DWP = NULL, then the unit column must be included in data_CO and all its units must be included among the column names of data_SS.
desc

Descriptive statistics for a fitted CP model
dateToDay

Calculate day of study from calendar date
dateCols

Select the date columns from a data table
obsCols_ltp

Select the columns from a data table that could be CP Last Time Present observations
cpmSetSizeFailRemove

Remove failed cpm models from a cpmSetSize object
cpmCPCellPlot

Plot cell-specific decay curve for carcass persistence
dlModTabSE

Create the download version of the Searcher Efficiency model table
dwpm

Fit density-weighted proportion (DWP) models.
logit

Compute the logit or anti-logit
expandModelSetCP

Expand a CP model set for plotting
combinePreds

Combine predictors
combinePredsAcrossModels

Combine predictors across models
estg

Estimate all carcass-level detection rates and arrival intervals
calcRate

Estimate the number of fatalities in each search interval throughout the monitoring period.
estgGenericSize

Estimate generic detection probability for multiple carcass classes
estgGeneric

Estimate generic g
calcSplits

Estimate the number of fatalities by up to two splitting covariates
obsCols_SE

Select the columns from a data table that could be SE observations
pkmSetSizeFail

Check if all of the pkm models fail
cpmSetSpecCPCellPlot

Plot cell-specific decay curve for carcass persistence
model_utility_functions

model utility functions (not exported)
ltranspose

Transpose a list of arrays
pkmSetFailRemove

Remove failed pkm models from a pkmSet object
pkmSetFail

Check if pkm models fail
pkLogLik

Calculate the negative log-likelihood of a searcher efficiency model
pkm

Fit pk searcher efficiency models.
plot.cpm

Plot results of a single CP model
pllogis

The CDF of the loglogistic distribution
pkmParamPlot

Plot parameter box plots for each cell for either p or k
pkmSetSizeFailRemove

Remove failed pkm models from a pkmSetSize object
pkmSetSpecSECellPlot

Plot cell-specific decay curve for searcher efficiency for a specific model with comparison to the cellwise model
pkmFail

Check if a pk model is well-fit
plot.gGeneric

Plot results of a single generic ghat estimation
mock

A mock example data set
plotSEBoxTemplate

template box plot
plot.splitFull

Plot summary statistics for splits of mortality estimates
pkmSetSpecParamPlot

p or k box plots for an SE model set
plot.splitSummary

Plot summary statistics for splits of mortality estimates
plotCPHeader

The CP plot header
print.corpus_frame

Generic S3 function for printing corpus_frame
prettySplitTab

Create the pretty version of the split summary table
rcp

Simulate parameters from a fitted cp model
pkmSECellPlot

Plot cell-specific decay curve for searcher efficiency
qpk

Quantiles of marginal distributions of \(\hat{p}\) and \(\hat{k}\)
plotSECells

Plot the cellwise results of a single model in a set of SE models
plotSEBoxPlots

p and k box plots for an SE model set
prettyModTabSE

Create the pretty versions of model and summary tables
refMod

Return the model with the greatest log-likelihood
plotSEHeader

The SE plot header
plotSEFigure

Plot results of a single SE model in a set
plot.gGenericSize

Plot results of a set of size-based generic ghat estimations
prettyModTabCP

Create the pretty version of the Carcass Persistence model table
plot.pkm

Plot results of a single pk model
removeCols

Remove selected columns from column names
pkmSetAllFail

Check if all of the pkm models fail within a given set
sizeCols

Select the potential carcass class columns from a data table
simpleMplot

Plot a total mortality estimation for a simple situation
ppersist

Calculate the probability of persistence to detection
predsCols

Select the predictor-ok columns from a data table
summary.gGenericSize

Summarize the gGenericSize list to a list of simple tables
summary.gGeneric

Summarize the gGeneric list to a simple table
plot.pkmSet

Plot results of a set of SE models
plotCPCells

Plot the cellwise results of a single model in a set of CP models
plotCPFigure

Plot results of a single CP model in a set
tidyModelSetSE

Tidy an SE model set
solar_trough

Trough-based solar thermal power simulated example
update_input

Update the inputs when an event occurs
trimSetSize

Trim a Model-Set-Size Complex to a Single Model Per Size
runGenEst

Launch the GenEst Application
rpk

Simulate parameters from a fitted pk model
prepPredictors

Prepare predictors based on inputs
prepSS

Create search schedule data into an prepSS object for convenient splits analyses
tidyModelSetCP

Tidy a CP model set
summary.splitFull

Summarize results of mortality estimate splits
transposeSplits

Transpose a splitFull array (preserving attributes)
wind_RP

Wind Road and Pad (120m) Example
wind_cleared

Wind cleared plot (60m) Search Example
summary.estM

Summarize total mortality estimation
wind_RPbat

Wind Bat-Only Road and Pad (120m) Example
print.cpm

Print a cpm model object
plot.cpmSet

Plot results of a set of CP models
plot.estM

Plot total mortality estimation
rdwp

Simulate parameters from a fitted dwp model
print.pkm

Print a pkm model object
update_rv

Update the reactive value list when an event occurs
solar_powerTower

Power Tower Example Dataset
update_output

Update the outputs when an event occurs
readCSV

Read in csv files in either format
solar_PV

Photovoltaic Example Dataset
CO_DWP

Associate CO carcasses with appropriate DWP values (by unit and carcass class)
SEboxes

Produce boxplots p and/or k for all cells for reference model and specific model
CPcols

Produce a named vector of standard CP plot colors
SEcols

Produce a named vectory with standard SE plot colors
SEfig

Plot results of a single SE model in a set
GenEst

Generalized estimation of mortality