Learn R Programming

phenology (version 10.1)

Parameter_Global_Year: Transform a set of parameters from Year to global effect, or reverse

Description

This function is used to transform a set of parameters that uses Peak, LengthB, LengthE, B, E, or Length to the same parameter with Year effect, or reverse.
The parameter series can be or a result from add_phenology() or from fit_phenology() or simply a vector of names.
If this is a vector of names, it is checked to remove _ characters.

Usage

Parameter_Global_Year(
  parameters = stop("A set of parameters must be indicated"),
  parname = c("Peak", "LengthB", "LengthE", "B", "E", "Length"),
  series = NULL,
  sep_year = "-",
  perYear = TRUE
)

Value

Return a set of modified parameters

Arguments

parameters

Set of current parameters

parname

Name of parameter to transform

series

Set of series (see description)

sep_year

Character used to separate the year

perYear

TRUE if year-specific values must be setup

Author

Marc Girondot marc.girondot@gmail.com

Details

Parameter_Global_Year transforms a set of parameters from Year to global effect, or reverse

Examples

Run this code
if (FALSE) {
Parameter_Global_Year(parameters=c("Peak_Beach1-2018"=151, "Peak_Beach1-2019"=161), 
                     parname="Peak", perYear=FALSE)
Parameter_Global_Year(parameters=c("Peak"=151), 
                      series = c("beach1", "beach2"), 
                     parname="Peak", perYear=TRUE)
}

Run the code above in your browser using DataLab