Learn R Programming

phenology (version 7.2)

plot.Tagloss: Plot the daily rate of tag loss.

Description

Plot the daily rate of tag loss. To use this function without a result of Tagloss_fit(), see the hack in examples. It does not work still with cumul and LR model.

Usage

# S3 method for Tagloss
plot(x, t = NULL, fitted.parameters = NULL,
  fixed.parameters = NULL, scale = 1, model_before = NULL,
  model_after = NULL, model = c("1", "2", "R1", "R2", "L1", "L2",
  "cumul", "cumul1"), col = grey.colors(4),
  text.col = rev(grey.colors(4)), add = FALSE, hessian = NULL,
  replicates = 1000, probs = c(0.025, 0.975), progressbar = FALSE,
  decoration = FALSE, ...)

Arguments

x

Object obteined from Tagloss_fit()

t

Time for which values of model must be ploted

fitted.parameters

Set of parameters

fixed.parameters

Another set of parameters without standard error associated

scale

Scale value. When Cumul is used, scale is always 1.

model_before

Transformation of parameters before to use Tagloss_model()

model_after

Transformation of parameters after to use Tagloss_model()

model

Can be 1, 2, R1, R2, L1, L2 or Cumul (2 tags) or Cumul1 (1 tag)

col

The colors of shading areas of cumul or the color of line

text.col

The text color for cumul model

add

Should the data be added to a previous plot?

hessian

Should confidence interval be shown

replicates

Number of replicates for confidence interval

probs

Quantiles to show for confidence interval

progressbar

Is shown a progressbar?

decoration

Try to add name of parameters on the graph

...

Parameters transmitted to plot

Value

A dataframe with values used for plotting.

Details

plot.tagloss plots the daily rate of tag loss.

See Also

Other Model of Tag-loss: Tagloss_LengthObs, Tagloss_L, Tagloss_daymax, Tagloss_fit, Tagloss_format, Tagloss_model, Tagloss_simulate, logLik.Tagloss

Examples

Run this code
# NOT RUN {
library(phenology)
# Example
t <- 1:1000

par <- c(D1_1=200, D2D1_1=100, D3D2_1=200, 
         A_1=-logit(0.02), B_1=-logit(0.05), C_1=-logit(0.07))
phenology:::plot.Tagloss(x=list(), t=t, fitted.parameters=par, model="1")
phenology:::plot.Tagloss(x=NULL, t=t, fitted.parameters=par, model="1", 
                         scale=1000, decoration = TRUE)

par <- c(D1_2=200, D2D1_2=100, D3D2_2=200, 
         A_2=-logit(0.05), B_2=-logit(0.03), C_2=-logit(0.03))
phenology:::plot.Tagloss(x=list(), t=t, fitted.parameters=par, ylim=c(0, 1), 
                         scale = 10, model="2")

par <- c(D1_L2=200, D2D1_L2=100, D3D2_L2=200, 
         A_L2=-logit(0.05), B_L2=-logit(0.07), C_L2=-logit(0.07))
phenology:::plot.Tagloss(x=list(), t=t, fitted.parameters=par, model="L2")

par <- c(D1_R2=200, D2D1_R2=0, D3D2_R2=700, 
         A_R2=-logit(0.02), B_R2=-logit(0.05), C_R2=-logit(0.07))
phenology:::plot.Tagloss(x=list(), t=t, fitted.parameters=par, model="R2", 
                         col="red", add=TRUE)

par <- c(D1_L1=200, D2D1_L1=2000, D3D2_L1=2000, 
        A_L1=-logit(0.05), B_L1=-logit(0.02), C_L1=-logit(0.1))
phenology:::plot.Tagloss(x=list(), t=t, fitted.parameters=par, model="L1")

# To plot the history of individuals
par <- c(D1_1=200, D2D1_1=100, D3D2_1=200, 
         A_1=-logit(5E-4), B_1=-logit(4E-4), C_1=-logit(5E-4), 
         D1_2=200, D2D1_2=100, D3D2_2=200, 
         A_2=-logit(6E-4), B_2=-logit(5E-4), C_2=-logit(6E-4))
phenology:::plot.Tagloss(x=list(), t=1:1000, fitted.parameters=par, model="Cumul", 
                         decoration = TRUE)
phenology:::plot.Tagloss(x=list(), t=1:1000, fitted.parameters=par, model="Cumul", 
                         decoration = TRUE, col=c("red", "green", "blue"))
                         
# To plot the history of individuals
par <- c(D1_R1=200, D2D1_R1=100, D3D2_R1=200, 
         A_R1=-logit(5E-4), B_R1=-logit(4E-4), C_R1=-logit(5E-4), 
         D1_R2=200, D2D1_R2=100, D3D2_R2=200, 
         A_R2=-logit(6E-4), B_R2=-logit(5E-4), C_R2=-logit(6E-4), 
         D1_L1=200, D2D1_L1=100, D3D2_L1=200, 
         A_L1=-logit(5E-4), B_L1=-logit(4E-4), C_L1=-logit(5E-4), 
         D1_L2=200, D2D1_L2=100, D3D2_L2=200, 
         A_L2=-logit(6E-4), B_L2=-logit(5E-4), C_L2=-logit(6E-4))
phenology:::plot.Tagloss(x=list(), t=1:1000, fitted.parameters=par, model="Cumul", 
                         decoration = TRUE)
# }

Run the code above in your browser using DataLab