Learn R Programming

SPARTAAS (version 1.2.7)

arrangePlot: arrangePlot

Description

plot muliple cerardat output

Usage

arrangePlot(x,
            which=1:2,
            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",
            date=NULL,
            col_date=NULL,
            lty_date=NULL,...
)

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 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.

date

x coordinate to highlight with a vertical line accross all plots (vector).

col_date

Vector of color for vertical lines (one for each date, could be numeric, hexadecimal, rgb).

lty_date

Vector of line type (see lty in par, don't use lty with arrangePlot) for vertical lines.

...

other parameters to be passed through to plotting functions (bty, lwd, cex.axis see par).

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
)

#Plot the first 5 with their dateEv fit as vertical line
arrangePlot(resultat,
  which = 1:5,
  date = resultat$prediction$Fit_dateEv[1:5]
)
arrangePlot(resultat,
  which = 1:5,
  xlim = c(300, 600),
  date = resultat$prediction$Fit_dateEv[1:5]
)

#Plot using row names and highlighting custom dates
arrangePlot(resultat,
  which = c("Z067","Z070","Z074"),
  main = "Neuvy-Le-Roi", 
  xlim = c(300, 1300), 
  date = c(669, 745, 850, 1115),
  col_date = c("red", rgb(0.20, 0.40, 0.30), 4, '#5614be')
)

#You can change the line type (lty) and the color of the curve
arrangePlot(resultat,
  which = c("Z067", "Z070", "Z074"),
  main = "Neuvy-Le-Roi", 
  col1 = rgb(0.7, 0.7, 0.7, 0.6), # the last arg of rgb is alpha for opacity
  col2 = "black",
  xlim = c(300, 1300), 
  date = c(669, 745, 850, 1115), 
  col_date = "grey50",
  lty_date = c(1, 2, 3, 4)    # 1: line, 2: dashed line, 3: dotted line, 4:mixed dotted dashed line)
)

#Default first 10 plot
arrangePlot(resultat, which = 1:10)

#You can remove the box arround the plot region
arrangePlot(resultat,
  which = 1:10,
  xlim = c(200, 1000),      # fix the x axis between 200 and 1000
  date = seq(250, 950, 50), # add one line every 50 years between 250 and 950
  col_date = "grey80",
  lty_date = 3,      # dotted line (1: line, 2: dashed line)
  bty = 'n',         # remove box ('L': keep bottom and left) 
  cex.axis = 0.8     # control axis text size (only y axis here) 
)

#minimalist version (remove y-axis)
arrangePlot(resultat,
  which = 1:10,
  xlim = c(200, 1000),       # fix the x axis between 200 and 1000
  date = seq(250, 950, 50),  # add one line every 50 years between 250 and 950
  col_date = "grey80",
  lty_date = 3,              # dotted line (1: line, 2: dashed line)
  ylab = '',                 # remove the y-axis name ('Density')
  fg = rgb(0, 0, 0, 0),      # color box transparent (invisible) 
  col.axis = rgb(0, 0, 0, 0),# color axis text (only y axis here) transparent (invisible)
  ov = "none"                # remove the overlap percentage
)

# }

Run the code above in your browser using DataLab