# list-based template
x <- list(
id = 'P1',
depths = c(25, 33, 100, 150),
name = c('A', 'Bw', 'Bt', 'Cr'),
clay = c(12, 15, 22, 25),
soil_color = c('10YR 3/3', '10YR 4/4', '10YR 4/6', '5G 6/2')
)
s <- quickSPC(x)
plotSPC(s, name.style = 'center-center', cex.names = 1)
# character template, mode 1
# horizon thickness is generated at random (uniform [5,20])
x <- 'A-Bt1-Bt2-Bt3-Cr-R'
s <- quickSPC(x)
plotSPC(s, name.style = 'center-center', cex.names = 1)
# multiple templates
x <- c(
'A-Bt1-Bt2-Bt3-Cr-R',
'A-C1-C2-C3-C4-Ab',
'Ap-A-A/E-E-Bhs-Cr'
)
# this interface is vectorized
s <- quickSPC(x)
plotSPC(s, name.style = 'center-center', cex.names = 1)
# optionally specify profile IDs using "ID:" prefix
x <- c(
'P1:A-Bt1-Bt2-Bt3-Cr-R',
'P2:A-C1-C2-C3-C4-Ab',
'P3:Ap-A-A/E-E-Bhs-Cr'
)
s <- quickSPC(x)
plotSPC(s, name.style = 'center-center', cex.names = 1)
# optionally specify:
# horizon bottom depths in cm
# soil color in Munsell notation
x <- c(
'1. simple:Oe-A-E-Bhs',
'2. full:Oe,10,10YR 2/2-A,20,10YR 3/3-E,30,2.5Y 8/2-Bhs,60,7.5YR 4/6'
)
s <- quickSPC(x)
plotSPC(s, name.style = 'center-center', cex.names = 1)
# use newline character as delimiter, more compact
x <- 'Oe,10,10YR 2/2
A,20,10YR 3/3
E,30,2.5Y 8/2
Bhs,60,7.5YR 4/6
BC,125,7.5YR 6/4
C,150,10YR 6/2'
plotSPC(quickSPC(x), name.style = 'center-center', cex.names = 1)
# character template, mode 2
# horizon thickness is proportional to replication of
# horizon designation and scaled by 'interval' argument
# default of 10 depth units
# e.g. A horizon is 3 * 10 = 30 depth units thick.
x <- c(
'AAA|BwBwBwBw|CCCCCCC|CdCdCdCd',
'ApAp|AA|E|BhsBhs|Bw1Bw1|CCCCC',
'A|Bt1Bt1Bt1|Bt2Bt2Bt2|Bt3|Cr|RRRRR'
)
# each horizon label is '10' depth-units (default)
s <- quickSPC(x)
plotSPC(s, name.style = 'center-center',
cex.names = 1, depth.axis = FALSE,
hz.depths = TRUE
)
# each horizon label is '5' depth-units
s <- quickSPC(x, interval = 5)
plotSPC(s, name.style = 'center-center',
cex.names = 1, depth.axis = FALSE,
hz.depths = TRUE
)
# optionally specify some / all profile IDs with "ID:" prefix
x <- c(
'P1:AAA|BwBwBwBw|CCCCCCC|CdCdCdCd',
'P2:ApAp|AA|E|BhsBhs|Bw1Bw1|CCCCC',
'A|Bt1Bt1Bt1|Bt2Bt2Bt2|Bt3|Cr|RRRRR'
)
s <- quickSPC(x)
plotSPC(s, name.style = 'center-center',
cex.names = 1, depth.axis = FALSE,
hz.depths = TRUE
)
# make a NODATA profile, with a random hash ID
# note the use of trailing horizon delimiter
# note the use of NA soil color field
x <- 'NODATA,150,NA-'
s <- quickSPC(x)
plotSPC(s, name.style = 'center-center',
cex.names = 1, depth.axis = FALSE,
hz.depths = TRUE)
Run the code above in your browser using DataLab