#' Show labels of colnames
#'
#' @param df one dataframe
#' @param order logical, whether order by colname
#' @return a dataframe contains colname and label
#' @export
#'
var_labels <- function(df,order=FALSE){
x <- sapply(df, expss::var_lab)
x[sapply(x, is.null)] <- ''
if (is.list(x)) label <- unlist(x) else label <- x
df <- data.frame(colname=names(x),
label=label)
if (order) df <- df[order(df[,1]),]
row.names(df)=NULL
df
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.