Description Usage Arguments Details Value Author(s) Examples

View source: R/plot.phenology.R

The function plot.phenology plots the phenology graph from a result object.

If cofactors have been added, the plot does not show their effects.

plot.objects can be "observations", "ML" for maximum likelihood, "ML.SD" for dispersion of observations, "ML.quantiles" or "MCMC.quantiles" if a mcmc object is given

1 2 3 4 5 6 7 8 | ```
## S3 method for class 'phenology'
plot(x, ..., series = "all", moon = FALSE,
replicate.CI = 10000, resultmcmc = NULL, chain = 1,
replicate.CI.mcmc = "all", level = 0.95,
plot.objects = c("observations", "ML", "ML.SD", "ML.quantiles",
"MCMC.quantiles"), col.ML = "black", col.SD = "red",
col.MCMC.quantiles = "purple", col.ML.quantiles = "black",
col.observations = "black", col.grouped.observations = "green")
``` |

`x` |
A result file generated by fit_phenology |

`...` |
Parameters used by plot |

`series` |
Name or number of series to be plotted or 'all' |

`moon` |
If TRUE, the moon phase is ploted. Default is FALSE |

`replicate.CI` |
Number of replicates for estimation of confidence interval |

`resultmcmc` |
A mcmc object |

`chain` |
The number of chain to be used in resultmcmc |

`replicate.CI.mcmc` |
Number of iterations to be used or "all" |

`level` |
Level to estimate confidence interval or credibility interval |

`plot.objects` |
What to plot? |

`col.ML` |
Color of the ML mean curve |

`col.SD` |
Color of the SD curve (distribution of observations) |

`col.MCMC.quantiles` |
Color of the quantiles curve based on mcmc |

`col.ML.quantiles` |
Color of the SE curve based on ML |

`col.observations` |
Color of the points |

`col.grouped.observations` |
Color of the lines indicating grouped observations |

plot.phenology plots the phenology.

A list with four objects: synthesis is a data.frame with global estimate of nesting.

details_MCMC, details_ML and details_mean are lists with day by day information for each series.

Marc Girondot

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ```
## Not run:
library(phenology)
# Read a file with data
Gratiot <- read.delim("http://max2.ese.u-psud.fr/epc/conservation/BI/Complete.txt", header=FALSE)
data(Gratiot)
# Generate a formatted list nammed data_Gratiot
data_Gratiot <- add_phenology(Gratiot, name = "Complete",
reference = as.Date("2001-01-01"), format="%d/%m/%Y")
# Generate initial points for the optimisation
parg <- par_init(data_Gratiot, fixed.parameters=NULL)
# Run the optimisation
result_Gratiot <- fit_phenology(data=data_Gratiot,
fitted.parameters=parg, fixed.parameters=NULL)
data(result_Gratiot)
# Plot the phenology and get some stats
output <- plot(result_Gratiot)
# Plot only part of the nesting season
ptoutput <- plot(result_Gratiot, xlim=c(as.Date("2001-03-01"),as.Date("2001-08-31")))
# Use month names in English
Sys.setlocale(category = "LC_TIME", locale = "en_GB.UTF-8")
output <- plot(result_Gratiot)
# set back the month name in local R language
Sys.setlocale(category = "LC_TIME", locale = "")
# plot based on quantiles of mcmc object
plot(result_Gratiot, resultmcmc=result_Gratiot_mcmc,
plot.objects=c("observations", "MCMC.quantiles"))
plot(result_Gratiot, resultmcmc=result_Gratiot_mcmc,
plot.objects=c("observations", "ML.SD", "ML.quantiles"))
plot(result_Gratiot, resultmcmc=result_Gratiot_mcmc,
plot.objects=c("observations", "ML.SD", "MCMC.quantiles"))
plot(result_Gratiot, resultmcmc=result_Gratiot_mcmc,
plot.objects=c("observations", "ML.quantiles", "MCMC.quantiles"))
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.