Learn R Programming

aqp (version 0.99-8.1)

profile_plot.default: Profile Plot

Description

Generate a simple diagram of a soil profile, with annotated horizon names.

Usage

## S3 method for class 'SoilProfileList':
profile_plot(d, color='soil_color', width=0.2, name='name', 
cex.names=0.5, cex.depth.axis=cex.names, cex.id=cex.names+(0.2*cex.names), 
print.id=TRUE, id.style='top', plot.order=1:d$num_profiles, add=FALSE, scaling.factor=1, y.offset=0, 
max.depth=d$max_depth, n.depth.ticks=5, shrink=FALSE, shrink.cutoff=3,
abbr=FALSE, abbr.cutoff=5, ...)

Arguments

d
a SoilProfileList object
color
the name of the column containing R-compatible color descriptions
width
scaling of profile widths
name
the name of the column containing the horizon designation
cex.names
character scaling applied to horizon names
cex.depth.axis
character scaling applied to depth scale
cex.id
character scaling applied to profile id
print.id
should the profile id be printed above each profile? (TRUE)
id.style
profile ID printing style: 'top' = centered above each profile (default), 'side' = 'along the top-left edge of profiles'
plot.order
a vector describing the order in which individual SoilProfile objects from the parent should be plotted
add
add to an existing figure
scaling.factor
vertical scaling of the profile heights
y.offset
vertical offset for top of profiles
max.depth
suggested lower depth boundary of plot
n.depth.ticks
suggested number of ticks in depth scale
shrink
should long horizon names be shrunk by 80% ?
shrink.cutoff
character length defining long horizon names
abbr
should the profile ID be abbreviated?
abbr.cutoff
suggested minimum length for abbreviated IDs
...
other arguments passed into lower level plotting functions

Value

  • A new plot of soil profiles is generated, or optionally added to an existing plot.

Details

This function sets the margins before plotting, so previous calls to par(mar=...) will be overridden. Depth limits (max.depth) and number of depth ticks (n.depth.ticks) are *suggestions* to the pretty() function. You may have to tinker with both parameters to get what you want. The 'side' id.style is useful when plotting a large collection of profiles, and/or, when profile IDs are long.

References

http://casoilresource.lawr.ucdavis.edu/

See Also

initProfileList, pretty

Examples

Run this code
library(aqp)
data(sp1)

# add color vector
sp1$soil_color <- with(sp1, munsell2rgb(hue, value, chroma))

# convert to SoilPofileList class object
sp1.list <- initProfileList(sp1)

# plot profiles
profile_plot(sp1.list)

# plot profiles, using alternate profile ID label style
profile_plot(sp1.list, id.style='side')

Run the code above in your browser using DataLab