Learn R Programming

aqp (version 2.3.1)

addDiagnosticBracket: Annotate Diagnostic Features

Description

Annotate diagnostic features within a sketch of soil profiles.

Usage

addDiagnosticBracket(
  s,
  kind,
  feature = "featkind",
  top = "featdept",
  bottom = "featdepb",
  ...
)

Arguments

s

SoilProfileCollection object

kind

character, filter applied to feature column of diagnostic horizons registered within s

feature

column name containing feature kind

top

column name containing feature top depth

bottom

column name containing feature top depth

...

additional arguments passed to addBracket()

Author

D.E. Beaudette

Details

Additional examples can be found in this tutorial.

See Also

addBracket(), plotSPC()

Examples

Run this code

 # example data
x <- c(
  'P1:AAA|BwBwBwBw|CCCCCCC|CdCdCdCd',
  'P2:Ap|AA|E|BhsBhs|Bw1Bw1|CCCCC',
  'P3:A|Bt1Bt1Bt1|Bt2Bt2Bt2|Bt3|Cr|RRRRR',
  'P4:AA|EEE|BhsBhsBhsBhs|BwBw|CCCCC',
  'P5:AAAA|ACACACACAC|CCCCCCCCCCC|CdCdCd'
)

s <- quickSPC(x)

diagnostic_hz(s) <- data.frame(
  id = c('P1', 'P4'),
  t = c(12, 25), 
  b = c(70, 100),
  kind = c('Best', 'Best')
)

op <- par(no.readonly = TRUE)
par(mar = c(0, 0, 3, 2))

# sketches
plotSPC(
  s, name = 'name', name.style = 'center-center', cex.names = 0.75, max.depth = 210
)

# note that custom top/bottom depths must be supplied
addDiagnosticBracket(
  s, feature = 'kind', kind = 'Best', top = 't', bottom = 'b',
  labcol = 'kind',
  offset = -0.35, col = 'firebrick', tick.length = 0.04, lwd = 2
)

par(op)


Run the code above in your browser using DataLab