Learn R Programming

embryogrowth (version 9.5)

plot.tsd: Plot results of tsd() that best describe temperature-dependent sex determination

Description

Plot the estimates that best describe temperature-dependent sex determination.
1515embryogrowth
3534embryogrowth
11754embryogrowth
5790embryogrowth

Usage

# S3 method for tsd
plot(
  x,
  ...,
  show.observations = TRUE,
  show.model = TRUE,
  males.freq = TRUE,
  show.PTRT = TRUE,
  las.x = 1,
  las.y = 1,
  lab.PT = paste("Pivotal ", x$type),
  resultmcmc = NULL,
  chain = 1,
  l = 0.05,
  replicate.CI = 10000,
  range.CI = 0.95,
  mar = c(4, 4, 4, 1) + 0.4,
  temperatures.plot = seq(from = 25, to = 35, by = 0.1),
  durations.plot = seq(from = 40, to = 70, by = 0.1),
  lab.TRT = paste0("Transitional range of ", x$type, "s l=", x$l * 100, "%"),
  col.TRT = "gray",
  col.TRT.CI = rgb(0.8, 0.8, 0.8, 0.8),
  col.PT.CI = rgb(0.8, 0.8, 0.8, 0.8),
  show.CI = TRUE,
  warn = TRUE,
  use.ggplot = TRUE
)

Value

Nothing

Arguments

x

A result file generated by tsd()

...

Parameters for plot()

show.observations

Should the observations be shown

show.model

Should the model be shown

males.freq

Should the graph uses males relative frequency TRUE or females FALSE

show.PTRT

Should the P and TRT information be shown

las.x

las parameter for x axis

las.y

las parameter for y axis

lab.PT

Label to describe pivotal temperature

resultmcmc

A result of tsd_MHmcmc()

chain

What chain to be used is resultmcmc is provided

l

Sex ratio limits to define TRT are l and 1-l

replicate.CI

replicate.CI replicates from the hessian matrix to estimate CI

range.CI

The range of confidence interval for estimation, default=0.95

mar

The par("mar") parameter

temperatures.plot

Temperatures used for showing curves of sex ratio

durations.plot

Durations used for showing curves of sex ratio

lab.TRT

Label to describe transitional range of temperature

col.TRT

The color of TRT

col.TRT.CI

The color of CI of TRT based on range.CI

col.PT.CI

The color of CI of PT based on range.CI

show.CI

Do the CI for the curve should be shown

warn

Do the warnings must be shown ? TRUE or FALSE

use.ggplot

Use ggplot graphics (experimental). TRUE or FALSE

Author

Marc Girondot

Details

plot.tsd plot result of tsd() that best describe temperature-dependent sex determination

See Also

Other Functions for temperature-dependent sex determination: DatabaseTSD, DatabaseTSD.version(), P_TRT(), ROSIE, ROSIE.version(), TSP.list, predict.tsd(), stages, tsd(), tsd_MHmcmc(), tsd_MHmcmc_p()

Examples

Run this code
if (FALSE) {
library(embryogrowth)
CC_AtlanticSW <- subset(DatabaseTSD, RMU.2010=="Atlantic, SW" & 
                          Species=="Caretta caretta" & (!is.na(Sexed) & Sexed!=0))
tsdL <- with (CC_AtlanticSW, tsd(males=Males, females=Females, 
                                 temperatures=Incubation.temperature.set, 
                                 equation="logistic"))
# By default, it will return a ggplot object
# Here I show the advantage of using a ggplot object
g <- plot(tsdL)
# You can remove named layers. For example:
names(g$layers)
g$layers["Observations"] <- NULL; plot(g)
# And add some
# Due to a bug in ggplot, it is necessary to remove all names to obtain correct legends
names(g$layers) <- NULL
g + geom_point(data=CC_AtlanticSW, aes(x=Incubation.temperature.set, y=Males/Sexed, 
               size = Sexed), inherit.aes = FALSE, show.legend = TRUE, shape=19)
# Force to use the original plot
plot(tsdL, use.ggplot = FALSE)
}

Run the code above in your browser using DataLab