Learn R Programming

SPARTAAS (version 1.2.7)

plot.cerardat_obj: plot cerardat model

Description

plot cerardat model

Usage

# S3 method for cerardat_obj
plot(x, 
  which = NULL,
  main="model dateEv (red) and dateAc (black)",
  xlab = "Date", 
  ylab = "Density",
  col1 = rgb(0.93,0.23,0.23,0.5), 
  col2 = "black",
  xlim=NULL, 
  ylim=NULL,
  ov="topright",...)

Arguments

x

a cerardat output.

which

Vector containing the plots you want (rownames or row number on the contingence table: numeric).

main

an overall title for the plot: see title.

xlab

a title for the x axis: see title.

ylab

a title for the y axis: see title.

col1

Color of the Event curve (color name, hex code, rgb function {grDevices} for transparency).

col2

Color of the Accumulation curve (color name, hex code, rgb function {grDevices} for transparency).

xlim

Two numeric values, specifying the left limit and the right limit of the scale.

ylim

Two numeric values, specifying the lower limit and the upper limit of the scale.

ov

Keywords indicating where to place the overlap value. This should be (an unambiguous abbreviation of) one of "topright", "topleft", "bottomright", "bottomleft" or "none". For more precise control over the placement, you can set ov to "none" and use text.

...

other parameters to be passed through to plotting functions (bty, cex.axis, las).

Author

A. COULON

L. BELLANGER

P. HUSI

Examples

Run this code
# \donttest{
data("datacerardat")

resultat = cerardat(df = datacerardat$df,
  row.sup = datacerardat$row.sup,
  date = datacerardat$date,
  nf = NULL,
  confidence = 0.95,
  graph = TRUE
)

#See the first plot
plot(resultat, which = 1)
plot(resultat, 
  which = 1, 
  xlim = c(200, 700),
  ylim = c(0, 0.03),
  col1 = rgb(0.7, 0.7, 0.7, 0.6), 
  col2 = "black", 
  las = 1,
  ov = "bottomright"
)
abline(v = resultat$prediction$date[1], col="grey60", lty=1)
abline(v = resultat$prediction$Fit_dateEv[1], col="grey60", lty=2)
abline(v = resultat$prediction$Median_dateAc[1], col="grey60", lty=3)
legend("topright", 
  legend=c("Date coin", "DateEv", "DateAc"),
  col="grey60",
  lty=c(1, 2, 3)
)

plot(resultat, which = 1, ov = "none")
text(x=600,y=0.01,labels=paste0("overlap: ",resultat$prediction$overlap,"%"),cex=0.8,col="grey20")

#See the first 10 plots
#plot(resultat, which = 1:10) 

#See all plots
#plot(resultat)
# }

Run the code above in your browser using DataLab