Title: | Life and Fertility Tables Specially for Insects |
---|---|
Description: | Life and Fertility Tables are appropriate to study the dynamics of arthropods populations. This package provides utilities for constructing Life Tables and Fertility Tables, related demographic parameters, and some simple graphs of interest. It also offers functions to transform the obtained data into a known format for better manipulation. This document is based on the article by Maia, Luiz, and Campanhola "Statistical Inference on Associated Fertility Life Table Parameters Using Jackknife Technique Computational Aspects" (April 2000, Journal of Economic Entomology, Volume 93, Issue 2) <doi:10.1603/0022-0493-93.2.511>. |
Authors: | Carlos Abimael Sarmiento Sanchez [aut, cre] |
Maintainer: | Carlos Abimael Sarmiento Sanchez <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2024-10-27 06:22:16 UTC |
Source: | CRAN |
Function to coerce the object displaying the Confidence Interval into a data frame.
## S3 method for class 'lifertableCI' as.data.frame(x, row.names = NULL, ...)
## S3 method for class 'lifertableCI' as.data.frame(x, row.names = NULL, ...)
x |
A lifertableCI object. |
row.names |
|
... |
additional arguments to be passed to or from methods. |
as.data.frame.lifertableCI
returns a data frame.
## Make the main object: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects, jackknife = TRUE) as.data.frame(lft$CI)
## Make the main object: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects, jackknife = TRUE) as.data.frame(lft$CI)
Function to coerce the object displaying Life Table into a data frame.
## S3 method for class 'lifertableLFT' as.data.frame(x, row.names = NULL, ...)
## S3 method for class 'lifertableLFT' as.data.frame(x, row.names = NULL, ...)
x |
A lifertableLFT object |
row.names |
|
... |
additional arguments to be passed to or from methods. |
as.data.frame.lifertableLFT
returns a data frame.
## Make the main object: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects) as.data.frame(lft$LIFERTABLE)
## Make the main object: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects) as.data.frame(lft$LIFERTABLE)
Function to coerce the object displaying Parameters into a data frame.
## S3 method for class 'lifertableParmEst' as.data.frame(x, row.names = NULL, ...)
## S3 method for class 'lifertableParmEst' as.data.frame(x, row.names = NULL, ...)
x |
A lifertableParmEst object |
row.names |
|
... |
additional arguments to be passed to or from methods. |
as.data.frame.lifertableParmEst
returns a data frame.
## Make the main object: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects) as.data.frame(lft$PARAMETERS)
## Make the main object: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects) as.data.frame(lft$PARAMETERS)
Function to coerce the object displaying Total Eggs into a data frame.
## S3 method for class 'lifertableTotEggs' as.data.frame(x, row.names = NULL, ...)
## S3 method for class 'lifertableTotEggs' as.data.frame(x, row.names = NULL, ...)
x |
A lifertableTotEggs object. |
row.names |
|
... |
additional arguments to be passed to or from methods. |
as.data.frame.lifertableTotEggs
returns a data frame.
## Make the main object: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects, TotalEggs = TRUE) as.data.frame(lft$TOTAL.EGGS)
## Make the main object: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects, TotalEggs = TRUE) as.data.frame(lft$TOTAL.EGGS)
This dataset provides reference information on two groups of insects to illustrate the usage of functions within this package.
Insects
Insects
A data frame with 404 rows and 6 columns:
Name of the group (Claudia, paty).
The number of the female to which each row belongs.
It is the age corresponding to the female. Stage in which it is found.
Eggs laid by each female at each age.
Sexrate at each age.
Survival at each age.
This dataset serves as an example for running the provided code snippets or as a reference for analyzing the functionality of this package.
This function enables users to obtain life and fertility tables, offering various configuration options for optimal usage. See "Details" section.
lifertable( ColumnFemale, ColumnAge, ColumnEggs, SexRate, Survival = 1, ColumnGroups, data, InitiationOfAdultStage = 0, jackknife = FALSE, TotalEggs = FALSE ) ## S3 method for class 'lifertable' print(x, ...) ## S3 method for class 'lifertableCI' print(x, title = TRUE, ...) ## S3 method for class 'lifertableLFT' print(x, ...) ## S3 method for class 'lifertableParmEst' print(x, ...) ## S3 method for class 'lifertableTest' print(x, ...) ## S3 method for class 'lifertableTotEggs' print(x, ...)
lifertable( ColumnFemale, ColumnAge, ColumnEggs, SexRate, Survival = 1, ColumnGroups, data, InitiationOfAdultStage = 0, jackknife = FALSE, TotalEggs = FALSE ) ## S3 method for class 'lifertable' print(x, ...) ## S3 method for class 'lifertableCI' print(x, title = TRUE, ...) ## S3 method for class 'lifertableLFT' print(x, ...) ## S3 method for class 'lifertableParmEst' print(x, ...) ## S3 method for class 'lifertableTest' print(x, ...) ## S3 method for class 'lifertableTotEggs' print(x, ...)
ColumnFemale |
Data vector containing information on Females. |
ColumnAge |
Data vector containing information on Age. |
ColumnEggs |
Data vector containing information on the Number of Eggs Laid. |
SexRate |
Sex rate of eggs laid by the female at a certain age. |
Survival |
Percent of offspring females alive until adulthood. By default, the value is set to 1, assuming that all offspring will survive to adulthood. |
ColumnGroups |
Optional data vector containing information on the Groups. It is optional if the database only contains information about one group. |
data |
An optional data frame containing the variables. If not found in
|
InitiationOfAdultStage |
Age at which females became adults.
If the database contains records from birth, entering this value is
unnecessary. ONLY ENTER THIS VALUE if the database begins from the adult
stage, and the values in |
jackknife |
Logical. If |
TotalEggs |
Logical. If |
x |
Object to be displayed. |
... |
Additional arguments to be passed to or from methods. |
title |
If |
ColumnFemale
and ColumnGroups
can be either a numeric vector or
a character vector. This means they may contain either numerical values or
labels corresponding to the female and to their respective group assignments.
The standard approach for storing the Sex Rate and Survival rate during the
experiment is to input this information into the corresponding columns for
each variable. If this information remains consistent within a group, you can
input that value without the need to repeat it every time. If your database
encompasses a single experimental group, simply enter the corresponding value
in the SexRate
and Survival
arguments. In the case of having
more than one group, you can input the values of SexRate
and
Survival
correspondingly into a vector containing as many elements as
there are groups (one sex ratio and one survival rate for each group).
Estimated Parameters:
Mean net contribution per female to the next generation.
Rate of natural increase in a closed population that has been subject to a constant age-specific schedule of fertility and mortality for a long period, and has converged to be a stable population.
Mean time span between the birth of individuals of a generation and that of the next generation.
Time span necessary for doubling the initial population.
It is a multiplication factor of the original population at each time period.
Rm it was determined by analytical approximation using Lotka’s (1907, 1913) equation:
lifertable
returns an object of class
"lifertable".
An object of class "lifertable" is a list containing the following components:
LIFERTABLE |
An object of class |
PARAMETERS |
An object of class |
TOTAL.EGGS |
If requested, an object of class |
CI |
If requested, an object of class |
T.TEST |
An object of class |
PSEUDOS |
A list containing the pseudo values generated from the Jackknife estimation |
GROUPS |
A list of the groups involved in the experiment. |
print(lifertable)
: Print a lifertable
object
print(lifertableCI)
: Print a lifertableCI
object, this is the object showing the Confidence Interval
print(lifertableLFT)
: Print a lifertableLFT
object, this is the object showing the Life and Fertility Table
print(lifertableParmEst)
: Print a lifertableParmEst
object, this is the object showing the Estimated Parameters
print(lifertableTest)
: Print a lifertableTest
object, this is the object showing the Student t - test
print(lifertableTotEggs)
: Print a lifertableTotEggs
object, this is the object showing the Eggs laid per Female
Maia, A. H., Luis, A. J., & Campanhola, C. (2000). "Statistical Inference on Associated Fertility Life Table Parameters Using Jackknife Technique: Computational Aspects". Journal of Economic Entomology, 93(2), 511-518. doi:10.1603/0022-0493-93.2.511
Portilla, M., Morales-Ramos, J. A., Guadalupe Rojas, M., & Blanco, C. A. (2014). "Chapter 8 - Life Tables as Tools of Evaluation and Quality Control for Arthropod Mass Production". Mass Production of Beneficial Organisms (241-275). doi:10.1016/B978-0-12-391453-8.00008-X
## The Insects database will be utilized: lifertable(Female, Age, Eggs, Sexrate, Survival, Group, data = Insects, jackknife = TRUE, TotalEggs = TRUE) ## The following expressions will yield the same result as above: ## lifertable(Insects$Female, Insects$Age, Insects$Eggs, Insects$Sexrate, ## Insects$Survival, Insects$Group, jackknife = TRUE, ## TotalEggs = TRUE) ## lifertable(Insects$Female, Insects$Age, Insects$Eggs, ## SexRate = 0.7, Survival = 0.9, Insects$Group, ## jackknife = TRUE, TotalEggs = TRUE) ## lifertable(Insects$Female, Insects$Age, Insects$Eggs, ## SexRate = c(0.7, 0.7), Survival = c(0.9, 0.9), ## Insects$Group, jackknife = TRUE, TotalEggs = TRUE)
## The Insects database will be utilized: lifertable(Female, Age, Eggs, Sexrate, Survival, Group, data = Insects, jackknife = TRUE, TotalEggs = TRUE) ## The following expressions will yield the same result as above: ## lifertable(Insects$Female, Insects$Age, Insects$Eggs, Insects$Sexrate, ## Insects$Survival, Insects$Group, jackknife = TRUE, ## TotalEggs = TRUE) ## lifertable(Insects$Female, Insects$Age, Insects$Eggs, ## SexRate = 0.7, Survival = 0.9, Insects$Group, ## jackknife = TRUE, TotalEggs = TRUE) ## lifertable(Insects$Female, Insects$Age, Insects$Eggs, ## SexRate = c(0.7, 0.7), Survival = c(0.9, 0.9), ## Insects$Group, jackknife = TRUE, TotalEggs = TRUE)
This function generates a plot illustrating the Distribution of Oviposition (y-axis) versus Age (x-axis), with separate representations for each group if multiple groups exist. The data is sourced from the original database.
plotDistrOvipos( ColumnFemale, ColumnAge, ColumnEggs, ColumnGroups, data, InitiationOfAdultStage = 0 )
plotDistrOvipos( ColumnFemale, ColumnAge, ColumnEggs, ColumnGroups, data, InitiationOfAdultStage = 0 )
ColumnFemale |
Data vector containing information on Females. |
ColumnAge |
Data vector containing information on Age. |
ColumnEggs |
Data vector containing information on the Number of Eggs Laid. |
ColumnGroups |
Optional data vector containing information on the Groups. It is optional if the database only contains information about one group. |
data |
An optional data frame containing the variables. If not found in
|
InitiationOfAdultStage |
Age at which females became adults.
If the database contains records from birth, entering this value is
unnecessary. ONLY ENTER THIS VALUE if the database begins from the adult
stage, and the values in |
Returns an object of class
c("gg", "ggplot").
## The Insects database will be used to generate the plot. plotDistrOvipos(Female, Age, Eggs, Group, data = Insects) ## The following expression will yield the same result as described above: plotDistrOvipos(Insects$Female, Insects$Age, Insects$Eggs, Insects$Group)
## The Insects database will be used to generate the plot. plotDistrOvipos(Female, Age, Eggs, Group, data = Insects) ## The following expression will yield the same result as described above: plotDistrOvipos(Insects$Female, Insects$Age, Insects$Eggs, Insects$Group)
This function generates a Plot representing the number of Eggs Laid by each Female throughout the entire experiment.
plotEggs(object)
plotEggs(object)
object |
|
Returns an object of class
c("gg", "ggplot").
## The main object will be created using the Insects database: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects, TotalEggs = TRUE) ## Possible usage scenarios ## 1. Direct Usage of the "lft" Object: plotEggs(lft) ## 2. Assigning the component "TOTAL.EGGS" to an object: TEggs <- lft$TOTAL.EGGS plotEggs(TEggs) ## 3. Direct usage of the component: plotEggs(lft$TOTAL.EGGS)
## The main object will be created using the Insects database: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects, TotalEggs = TRUE) ## Possible usage scenarios ## 1. Direct Usage of the "lft" Object: plotEggs(lft) ## 2. Assigning the component "TOTAL.EGGS" to an object: TEggs <- lft$TOTAL.EGGS plotEggs(TEggs) ## 3. Direct usage of the component: plotEggs(lft$TOTAL.EGGS)
Construction of Plots for the pseudo-values of associated Life Table parameters.
PlotPseudoVals(object)
PlotPseudoVals(object)
object |
An object inheriting from |
Returns an object of class
c("gg", "ggplot").
## The main object will be created using the Insects database: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects, jackknife = TRUE) PlotPseudoVals(lft)
## The main object will be created using the Insects database: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects, jackknife = TRUE) PlotPseudoVals(lft)
This function generates the graphical representation of the Life Table. Survival (y-axis) versus Age (x-axis)
plotSurvivalCurve(object)
plotSurvivalCurve(object)
object |
|
Returns an object of class
c("gg", "ggplot").
## The main object will be created using the Insects database: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects) ## Possible usage scenarios ## 1. Direct Usage of the "lft" Object: plotSurvivalCurve(lft) ## 2. Assigning the component "LIFERTABLE" to an object: lifeTable <- lft$LIFERTABLE plotSurvivalCurve(lifeTable) ## 3. Direct usage of the component: plotSurvivalCurve(lft$LIFERTABLE)
## The main object will be created using the Insects database: lft <- lifertable(Female, Age, Eggs, Sexrate, ColumnGroups = Group, data = Insects) ## Possible usage scenarios ## 1. Direct Usage of the "lft" Object: plotSurvivalCurve(lft) ## 2. Assigning the component "LIFERTABLE" to an object: lifeTable <- lft$LIFERTABLE plotSurvivalCurve(lifeTable) ## 3. Direct usage of the component: plotSurvivalCurve(lft$LIFERTABLE)