diff --git a/R/colorQuantiles.R b/R/colorQuantiles.R index d99a6f40d..0bcd3f4f8 100644 --- a/R/colorQuantiles.R +++ b/R/colorQuantiles.R @@ -20,9 +20,9 @@ #' #' @description Estimate central tendency and spread of soil color using marginal quantiles and L1 median of CIELAB coordinates. #' -#' @details Colors are converted from sRGB to CIELAB (D65 illuminant), marginal quantiles of L,A,B coordinates are estimated, and L1 median {L,A,B} is estimates. The closest Munsell chips (via Munsell/CIELAB lookup table provided by \code{munsell}) and R colors are determined by locating chips closest to the marginal quantiles and L1 median. +#' @details Colors are converted from sRGB to CIELAB (D65 illuminant), marginal quantiles of (L,A,B) coordinates are estimated, and L1 median (L,A,B) is estimates. The closest Munsell chips (via Munsell/CIELAB lookup table provided by `munsell`) and R colors are determined by locating chips closest to the marginal quantiles and L1 median. #' -#' The results can be conveniently inspected using \code{plotColorQuantiles}. +#' The results can be conveniently inspected using [plotColorQuantiles()]. #' #' @author D.E. Beaudette #' diff --git a/R/generalize.hz.R b/R/generalize.hz.R index f79f43b02..8570f1370 100644 --- a/R/generalize.hz.R +++ b/R/generalize.hz.R @@ -170,9 +170,9 @@ setMethod("generalizeHz", signature(x = "SoilProfileCollection"), function(x, ne #' @description Convert a cross-tabulation: {original, genhz} to adjacency matrix. #' #' @param tab table, cross-tabulation of original and generalized horizon labels e.g. `table(original, genhz)` -#' +#' @return adjacency matrix +#' @author D.E. Beaudette #' @export -#' @rdname hzTransitionProbabilities genhzTableToAdjMat <- function(tab) { tab <- as.matrix(tab) # extract unique set of names diff --git a/R/hzTransitionProbabilities.R b/R/hzTransitionProbabilities.R index 121541d31..cdd5f7bd2 100644 --- a/R/hzTransitionProbabilities.R +++ b/R/hzTransitionProbabilities.R @@ -1,4 +1,4 @@ -# generate transition probability matrix from horizon designations + #' @title Horizon Transition Probabilities #' #' @description Functions for creating and working with horizon (sequence) transition @@ -9,7 +9,7 @@ #' * [horizon designation TP](http://ncss-tech.github.io/AQP/aqp/hz-transition-probabilities.html) #' * [soil color TP](http://ncss-tech.github.io/AQP/aqp/series-color-TP-graph.html) #' -#' @aliases hzTransitionProbabilities genhzTableToAdjMat mostLikelyHzSequence +#' @aliases hzTransitionProbabilities mostLikelyHzSequence #' #' @param x a `SoilProfileCollection` object. #' diff --git a/R/mostLikelyHzSequence.R b/R/mostLikelyHzSequence.R index 29f9b9288..48bd06d38 100644 --- a/R/mostLikelyHzSequence.R +++ b/R/mostLikelyHzSequence.R @@ -46,6 +46,7 @@ mostLikelyHzSequence <- function(mc, t0, maxIterations = 10) { if(i > maxIterations) break } + return(s) } diff --git a/man/colorQuantiles.Rd b/man/colorQuantiles.Rd index 84b770728..67755c451 100644 --- a/man/colorQuantiles.Rd +++ b/man/colorQuantiles.Rd @@ -22,9 +22,9 @@ A List containing the following elements: Estimate central tendency and spread of soil color using marginal quantiles and L1 median of CIELAB coordinates. } \details{ -Colors are converted from sRGB to CIELAB (D65 illuminant), marginal quantiles of L,A,B coordinates are estimated, and L1 median {L,A,B} is estimates. The closest Munsell chips (via Munsell/CIELAB lookup table provided by \code{munsell}) and R colors are determined by locating chips closest to the marginal quantiles and L1 median. +Colors are converted from sRGB to CIELAB (D65 illuminant), marginal quantiles of (L,A,B) coordinates are estimated, and L1 median (L,A,B) is estimates. The closest Munsell chips (via Munsell/CIELAB lookup table provided by \code{munsell}) and R colors are determined by locating chips closest to the marginal quantiles and L1 median. -The results can be conveniently inspected using \code{plotColorQuantiles}. +The results can be conveniently inspected using \code{\link[=plotColorQuantiles]{plotColorQuantiles()}}. } \examples{ diff --git a/man/genhzTableToAdjMat.Rd b/man/genhzTableToAdjMat.Rd new file mode 100644 index 000000000..30010556c --- /dev/null +++ b/man/genhzTableToAdjMat.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/generalize.hz.R +\name{genhzTableToAdjMat} +\alias{genhzTableToAdjMat} +\title{Convert cross-tabulation to adjacency matrix.} +\usage{ +genhzTableToAdjMat(tab) +} +\arguments{ +\item{tab}{table, cross-tabulation of original and generalized horizon labels e.g. \code{table(original, genhz)}} +} +\value{ +adjacency matrix +} +\description{ +Convert a cross-tabulation: {original, genhz} to adjacency matrix. +} +\author{ +D.E. Beaudette +} diff --git a/man/hzTransitionProbabilities.Rd b/man/hzTransitionProbabilities.Rd index e2a0baec9..4e8680172 100644 --- a/man/hzTransitionProbabilities.Rd +++ b/man/hzTransitionProbabilities.Rd @@ -1,14 +1,11 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/generalize.hz.R, R/hzTransitionProbabilities.R, +% Please edit documentation in R/hzTransitionProbabilities.R, % R/mostLikelyHzSequence.R -\name{genhzTableToAdjMat} -\alias{genhzTableToAdjMat} +\name{hzTransitionProbabilities} \alias{hzTransitionProbabilities} \alias{mostLikelyHzSequence} -\title{Convert cross-tabulation to adjacency matrix.} +\title{Horizon Transition Probabilities} \usage{ -genhzTableToAdjMat(tab) - hzTransitionProbabilities( x, name = GHL(x, required = TRUE), @@ -18,8 +15,6 @@ hzTransitionProbabilities( mostLikelyHzSequence(mc, t0, maxIterations = 10) } \arguments{ -\item{tab}{table, cross-tabulation of original and generalized horizon labels e.g. \code{table(original, genhz)}} - \item{x}{a \code{SoilProfileCollection} object.} \item{name}{A horizon level attribute in \code{x} that names horizons.} @@ -46,8 +41,6 @@ horizons, given a \code{markovchain} object initialized from horizon transition probabilities and an initial state, \code{t0}. See examples. } \description{ -Convert a cross-tabulation: {original, genhz} to adjacency matrix. - Functions for creating and working with horizon (sequence) transition probability matrices.