Learn R Programming

phenology (version 10.1)

phenology2fitRMU: Create the data to be used with fitRMU() for a summary(phenology).

Description

This function takes the result of plot.phenology() and generates the information to be used with fitRMU().
The value of density can be dnorm or dgamma. dnorm is better if ML results are used and dgamma is for MCMC.
Here are some example of regular expressions (regex) in grep:
If format of timeseries is beachname-2005:
rookeries.names.grep="(.+)-.+"
years.grep=".+-(.+)$"
Examples:
gsub("(.+)-.+", "\\1", "beachname-2005"); gsub(".+-(.+)$", "\\1", "beachname-2005")
If format of timeseries is beachname-2005-2006:
rookeries.names.grep="(.+)-.+-.+"
years.grep=".+-([0-9][0-9][0-9][0-9])-.+$"
Examples:
gsub("(.+)-.+-.+", "\\1", "beachname-2005-2006"); gsub(".+-([0-9][0-9][0-9][0-9])-.+$", "\\1", "beachname-2005-2006")
If format of timeseries is beachname-20052006:
rookeries.names.grep="(.+)-.+"
years.grep=".+-([0-9][0-9][0-9][0-9])([0-9][0-9][0-9][0-9])$"
Examples:
gsub("(.+)-.+", "\\1", "beachname-20052006"); gsub(".+-([0-9][0-9][0-9][0-9])([0-9][0-9][0-9][0-9])$", "\\1", "beachname-20052006")
The return is a list with these elements:
RMU.data, years.byrow, colname.year, and RMU.names.
If density is a vector, the density used is linked to the rank of the timeseries in phenologyout.

Usage

phenology2fitRMU(
  phenologyout = stop("A result obtained from summary(phenology)"),
  col.mean = "with_obs_Mean_ML",
  col.var = "with_obs_Var_ML",
  rookeries.names.grep = "(.+)-.+",
  years.grep = ".+-(.+)$",
  limit.cv = +Inf,
  limit.sd = +Inf,
  density = "dgamma"
)

Value

Return a list with elements ready to be used with fitRMU().

Arguments

phenologyout

A result of plot.phenology() or summary()

col.mean

Name of the column to be used as mean value. Can be a vector.

col.var

Name of the column to be used as variance value. Can be a vector.

rookeries.names.grep

The pattern to return the rookery name from names of timeseries.

years.grep

The pattern to return the year from names of timeseries.

limit.cv

Remove data with higher coefficient of variation than the limit.

limit.sd

Remove data with higher standard deviation than the limit.

density

What density should be used. Can be dnorm or dgamma. Can be a vector.

Author

Marc Girondot

Details

phenology2fitRMU is used to prepare output of phenology to be used by fitRMU()

See Also

Other Phenology model: AutoFitPhenology(), BE_to_LBLE(), Gratiot, LBLE_to_BE(), LBLE_to_L(), L_to_LBLE(), MarineTurtles_2002, MinBMinE_to_Min(), adapt_parameters(), add_SE(), add_phenology(), extract_result(), fit_phenology(), likelihood_phenology(), logLik.phenology(), map_Gratiot, map_phenology(), par_init(), phenology(), phenology_MHmcmc(), phenology_MHmcmc_p(), plot.phenology(), plot.phenologymap(), plot_delta(), plot_phi(), print.phenology(), print.phenologymap(), print.phenologyout(), remove_site(), result_Gratiot, result_Gratiot1, result_Gratiot2, result_Gratiot_Flat, result_Gratiot_mcmc, summary.phenology(), summary.phenologymap(), summary.phenologyout()

Examples

Run this code
if (FALSE) {
library("phenology")
}

Run the code above in your browser using DataLab