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