StrucTimeDiag: A function to add specific options to levelplot for plotting...

Description Usage Arguments Value Note Author(s) See Also Examples

Description

This function is based on the lattice function levelplot and is specifically designed to help plot structure-time diagrams. It takes as input a data frame of the form x, y, z, and plots z~x*y.

Usage

1
2
3
4
5
6
STdiag(formula=NULL, data, 
    main = NULL, 
    xlab = NULL, ylab = NULL, 
    log = TRUE, 
    zlim = NULL, znb = 50, 
    color = F, bgcolor = rgb(254,254,226,maxColorValue=255))

Arguments

formula

Formula to plot the data. Must be of the form z~x*y with x, y and z being names of columns of the data frame data.

data

Data frame to plot as a structure-time diagram. If formula is not provided, it must be a three columns data frame with colomns being x, y and z.

main

If provided, puts a title on the structure-time diagram.

xlab

If provided, puts a label on the X-axis of the structure-time diagram.

ylab

If provided, puts a label on the Y-axis of the structure-time diagram.

log

Boolean to choose between log scaled color gradient (TRUE) or linear (FALSE).

zlim

numeric vector, c(zmin, zmax), specify the range of color to use. If NULL, zlim=range(z)

znb

integer, specifies the number of colors to use

color

character string, type of color gradient to use. can be either one of gray, topo, terrain heat, tim, cm or rainbow. default is rainbow

bgcolor

rgb(), color of the background of the plot.

Value

No values is returned. Only the diagram is displayed. To record the plot, use usual display functions such as pdf().

Note

For further details on the use of levelplot, please refer to help(levelplot).

Author(s)

Vincent Le Bourlot

See Also

levelplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(sample)

# Diagram with linear grayscale for z axis
STdiag(data=sample,log=FALSE,color="gray")

# Diagram with linear tim color scale for z axis
STdiag(data=sample,log=FALSE,color="tim")

# Diagram with log rainbow color scale for z axis
STdiag(data=sample)

StructureTimeDiagram documentation built on May 2, 2019, 4:31 p.m.