Learn R Programming

embryogrowth (version 6.4)

MovingIncubation: Simulate incubation of a nest with the beginning of incubation varying

Description

Simulate incubation of a nest with the beginning varying day by day Temperatures must be in a data.frame with one column (Time) being the time and the second the temperatures (Temperature). A third columns can indicate the temperature at the end of incubation (Temperature.end.incubation). Do not use FormatNests() for this dataframe.

Usage

MovingIncubation(NestsResult = NULL, temperatures.df = stop("A data.frame with timeseries of temperatures must be provided"), metabolic.heating = 0, temperature.heterogenetity = 0, average.incubation.duration = 60 * 1440, skip = 1, parameters = NULL, fixed.parameters = NULL, SE = NULL, derivate = NULL, test = NULL, M0 = NULL, TSP.borders = c(21, 26), embryo.stages = "Caretta caretta.SCL", SexualisationTRN = NULL, replicate.CI = 1, progress = TRUE)

Arguments

NestsResult
A result file generated by searchR
temperatures.df
A data.frame with 2 or 3 columns: Times, Temperatures and Temperatures.end.incubation (facultative)
metabolic.heating
Degrees Celsius to be added at the end of incubation due to metabolic heating
temperature.heterogenetity
The SD of intercept temperature for a nest
average.incubation.duration
The average time to complete incubation (not used if metabolic heating is setup)
skip
Number of data to skip between two runs
parameters
A set of parameters if result is not provided.
fixed.parameters
Another set of parameters if result is not provided.
SE
Standard error for each parameter if not present in result is not provided
derivate
Function used to fit embryo growth: dydt.Gompertz, dydt.exponential or dydt.linear
test
Mean and SD of size of hatchlings as a vector ie test=c(Mean=xx, SD=yy)
M0
Measure of hatchling size proxi at laying date
TSP.borders
The limits of TSP
embryo.stages
The embryo stages. At least TSP.borders stages must be provided to estimate TSP length
SexualisationTRN
A set of parameters used to model thermal reaction norm during TSP
replicate.CI
Number of randomizations to estimate CI
progress
If TRUE, progression bar is shown (desactivate for sweave or knitr)

Value

A dataframe with informations about thermosensitive period length and incubation length day by day of incubation

Details

MovingIncubation simulate incubation of a nest with the beginning varying day by day

Examples

Run this code
## Not run: 
# library(embryogrowth)
# data(resultNest_4p)
# ti <- seq(from=0, to=(60*24*100), by=60)
# temp <- rnorm(length(ti), 29, 5)
# temp <- temp+ti/(60*24*100)/2
# layout(mat=1:3)
# parpre <- par(mar=c(4, 4, 1, 1)+0.4)
# plot(ti/(60*24), temp, type="l", xlab="Days", 
#      ylab=expression("Nest temperature in "*degree*"C"), bty="n", las=1)
# # The sexualisation thermal reaction norm is calculated for South Pacific RMU
# out <- MovingIncubation(NestsResult=resultNest_4p, 
#      temperatures.df=data.frame(Time=ti, Temperature=temp),
#      metabolic.heating=0, 
#      SexualisationTRN = structure(c(71.922411148397, 613.773055147801, 
#      318.059753164125, 120.327257089974), 
#      .Names = c("DHA", "DHH", "T12H", "Rho25")))
# with(out, plot(Time/(60*24), Incubation.length.mean/(60*24), 
#      xlab="Days along the season", 
#      ylab="Incubation duration", 
#      type="l", bty="n", las=1, ylim=c(74, 78)))
# with(out, plot(Time/(60*24), TSP.MassWeighted.STRNWeighted.temperature.mean, 
#      xlab="Days along the season", 
#      ylab=expression("CTE for sex ratio in "*degree*"C"), 
#       type="l", bty="n", las=1, ylim=c(20, 35)))
# par(mar=parpre)
# layout(mat=c(1))
# ## End(Not run)

Run the code above in your browser using DataLab