knitr::opts_chunk$set(echo = TRUE)

# report.Rmd should source user-defined configuration from config.R
source("config.R")

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

library(aqp)
library(soilDB)
library(sharpshootR)

# get morphology + extended summaries

s <- fetchOSD(soils, extended = TRUE)

Including Plots

You can also embed plots, for example:

par(mar = c(0, 1, 0, 4), xpd = NA)

res <- vizHillslopePosition(s$hillpos, annotation.cex = 0.9)

plotSPC(
  s$SPC,
  plot.order = res$order,
  cex.names = 1,
  axis.line.offset = -0.1,
  width = 0.2
)
# viz of hillslope position, from SSURGO component records
print(res$fig)

Example: Identify Tabular Siblings

siblingresult <- siblings(siblings_of, only.major = FALSE, component.data = TRUE)

# limit to named soil series
sib.data <- subset(siblingresult$sib.data, 
                   !compkind %in% c('Miscellaneous area', 'Family', 'Taxon above family'))

# get parsed OSD records
sibs <- fetchOSD(c(siblings_of, unique(siblingresult$sib$sibling)), extended = TRUE)
# invert colors
par(mar = c(0, 0, 0, 0),
    fg = 'white',
    bg = 'black')

SoilTaxonomyDendrogram(
  sibs$SPC,
  dend.width = 1.5,
  y.offset = 0.4,
  scaling.factor = 0.02,
  width = 0.2,
  cex.taxon.labels = 1,
  cex.names = 1
)


ncss-tech/soilReports documentation built on April 25, 2024, 1:03 a.m.