DistFitLong: Visually examine the mean-variance relationship of data

Description Usage Arguments Value Examples

View source: R/DistFitLong.R

Description

These functions plot data by group, and overlay lines representing three family functions that are commonly used for count data: NB1, NB2, and Poisson. For more information on this, please reference this document.

Usage

1
2
3
DistFitLong(Splitters, Data, CountCol, GroupCol, GroupList, ThemeBlack = T)

DistFitWide(Splitters, Data, GroupList, ThemeBlack = T)

Arguments

Splitters

A character vector of column names to aggregate data by.

Data

The unquoted name of the data frame or data table containing the raw data models are based on.

CountCol

A character string specifying the name of the vector containing count data.

GroupCol

A character string specifying the name of the vector containing group information (e.g., order, species) for each observation.

GroupList

A character vector of column names representing groups that define model membership (e.g., species, demographics).

ThemeBlack

A logical value indicating whether the plots generated should include theme_nocturnal (T) or not (F).

Value

These functions produces a mean/variance plot with NB1, NB2, and Poisson family function lines for each group in the vector supplied to the GroupList argument. Each resultant plot is named with the group name followed by "DistPlot" (e.g., the plot associated with a group named "Epfu" would be named "EpfuDistPlot".)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#DistFitWide Example
data("BatDataWide", package = "EcoCountHelper")

DistFitWide(c("Site", "Year"),
                BatDataWide, c("Myev", "Epfu"))
                
EpfuDistPlot
MyevDistPlot

#DistFitLong Example
data("BatDataLong", package = "EcoCountHelper")

DistFitLong(c("Site", "Year"),
  BatDataLong, "Count", "Species", c("Myev", "Epfu"))
  
EpfuDistPlot
MyevDistPlot

huntercole25/EcoCountHelper documentation built on July 21, 2020, 8:56 p.m.