#' Apply a function over a list or vector using names
#'
#' @param X A list or vector.
#' @param FUN A function to be applied to each element. The first two
#' arguments provided to `FUN` are the element name and element value.
#' @param ... Additional arguments to FUN.
#' @return A list with names like X.
#' @export
lapply_names <- function (X, FUN, ...) {
mapply(FUN, names(X), X, ..., SIMPLIFY=F)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.