eplot: A lattice-based plot of elements on multiple panels

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

View source: R/eplot.R

Description

This function is used for plotting depth functions of given elements in one or more soil profile(s)

Usage

1
eplot(data, element, panel = NULL, groups = NULL, ...)

Arguments

data

An object of class 'profile.data.frame'

element

A string giving the element as in colum name of data

panel

A vector of grouping factor for the conditioning variables (which define the subsets plotted in different panels) to be used in the plot. If NULL it defaults to the column named Profile, and plots elements as defined in 'element' subsetted for different profiles.

groups

An additional subgroup which controls colors of the elements plotted in each panel.

...

Other arguments as in 'xyplot' function in package 'lattice'.

Details

This function plots element in 'element' according to the subsetting provided in 'panel', and 'groups'. It is provided to rapidly obtain a depth function of a given variable, subsetted by profile in case of multiple-profile datasets.

Value

The high-level functions documented here, as well as other high-level Lattice functions, return an object of class 'trellis'. See ?xyplot for more details.

Author(s)

Gianluca Filippa

See Also

plot.profile.data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## plot of organic C depth functions in 5 profiles
eplot(example, 'Corg', col='black', type='b', main='Example',
             xlab='Organic C (percent)', ylab='Depth')

## different colors according to different soil profiles
eplot(example, 'Corg', type='b', main='Example',
             xlab='Organic C (%)', ylab='Depth', groups=example$Profile,
             panel=1, col=palette()[1:4])
## an example to add a legend with trellis (lattice) commands
    trellis.focus("toplevel") ## has coordinate system [0,1] x [0,1]
  panel.text(0.65, 0.63, "Site", cex = 0.8, font = 2, pos=4)
  panel.text(0.65, 0.59, "P1", cex = 0.8, pos=4)
  panel.text(0.65, 0.56, "SG2", cex = 0.8, pos=4, col=palette()[2])
  panel.text(0.65, 0.53, "SG5", cex = 0.8, pos=4, col=palette()[3])
  panel.text(0.65, 0.50, "SG7", cex = 0.8, pos=4, col=palette()[4])
  trellis.unfocus()   

Example output

Loading required package: aqp
This is aqp 1.17

Attaching package: 'aqp'

The following object is masked from 'package:base':

    union

Loading required package: lattice
Loading required package: munsell
Loading required package: splancs
Loading required package: sp

Spatial Point Pattern Analysis Code in S-Plus
 
 Version 2 - Spatial and Space-Time analysis

soilprofile documentation built on May 29, 2017, 10:50 p.m.