Learn R Programming

phenology (version 7.2)

adapt_parameters: Extract the parameters from a set of parameters to be used with another dataset.

Description

The function "adapt_parameters" extracts the set of parameters to be used with a subset of data. All the uncessary parameters are removed. It can be used when a set of beaches are fitted first and after only one of these beaches is fitted again.

Usage

adapt_parameters(data = stop("Datasets is mandatory for this function"),
  parameters = stop("Set of parameters is mandatory for this function"))

Arguments

data

A dataset of counts

parameters

A set of parameters

Value

Return the set of parameters

Details

adapt_parameters get the fitted parameters from a result object.

Examples

Run this code
# NOT RUN {
library(phenology)
# Read a file with data
data(Gratiot)
# Generate a formatted list nammed data_Gratiot 
refdate <- as.Date("2001-01-01")
data_Gratiot<-add_phenology(Gratiot, name="Complete", 
		reference=refdate, format="%d/%m/%Y")
# Generate initial points for the optimisation
parg<-par_init(data_Gratiot, fixed.parameters=NULL)
# Add unnecessary parameters to parg
parg <- c(parg, Max_dummybeach=2, Peak_dummybeach=123)
# Extract the fitted parameters
parg1<-adapt_parameters(data=data_Gratiot, parameters=parg)
# }

Run the code above in your browser using DataLab