Learn R Programming

aqp (version 1.25)

hzTopographyCodeToLineType: Convert Horizon Boundary Topography Distinctness to Line Type

Description

This function will convert USDA-NCSS horizon boundary topography codes into line types, based on the Field Book for Describing and Sampling Soils, version 3.0.

Usage

hzTopographyCodeToLineType(
  x,
  codes = c("S", "W", "I", "B"),
  lty = c(1, 2, 3, 4)
)

Arguments

x

vector of boundary topography codes to be converted

codes

code values, adjust as needed

lty

line types

Value

vector of line types with same length as x

References

Field Book for Describing and Sampling Soils, version 3.0

See Also

plotSPC

Examples

Run this code
# NOT RUN {
# example data
data(sp1)

# compute 1/2 transitional zone thickness from distinctness codes
sp1$hzdo <- hzDistinctnessCodeToOffset(sp1$bound_distinct)

# convert colors from Munsell to hex-encoded RGB
sp1$soil_color <- with(sp1, munsell2rgb(hue, value, chroma))

# promote to SoilProfileCollection
depths(sp1) <- id ~ top + bottom

# adjust margins
op <- par(mar=c(0,0,0,1.5))

# sketches, adjust width, adjust text size, include coded hz distinctness offsets
plotSPC(sp1, width=0.3, cex.names=0.75, hz.distinctness.offset = 'hzdo')

# clean-up
par(op)
# }

Run the code above in your browser using DataLab