#' base::dim, but returning 1 for vector
#'
#' @param x Object to get dimensions on
#' @export
dim = function(x) {
if (is.null(x) || is.vector(x))
length(x)
else
base::dim(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.