##' Select by year from a \code{data.frame} with years as
##' \code{\link{rownames}}
##'
##'
##' Select by year or set/range of years from a \code{data.frame},
##' that uses years as \code{\link{rownames}}, such as
##' \code{\link{data.frames}} with tree-ring data used in
##' \code{\link{dplR}} or \code{\link{bootRes}}.
##' @title Select by year(s)
##' @param x a data.frame
##' @param years a set of years
##' @return a subset-data.frame
##' @export
select <- function(x, years) {
a <- as.numeric(rownames(x)) %in% years
if (!is.null(dim(x))) {
x[a, ]
} else {
x[a]
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.