#' @title sort_data_frame
#' @description unknown
#' @family abysmally documented
#' @author unknown, \email{<unknown>@@dfo-mpo.gc.ca}
#' @export
sort_data_frame <- function(x, key, ...) {
if (missing(key)) {
rn <- rownames(x)
if (all(rn %in% 1:nrow(x))) rn <- as.numeric(rn)
x[order(rn, ...), , drop=FALSE]
} else {
x[do.call("order", c(x[key], ...)), , drop=FALSE]
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.