#' View factor information for each variable in data frame
#'
#' Obtain the variable name, class, levels, and ordered status
#'
#' @param df data frame
#' @param i integer
#'
#' @return list
#' @export
#'
#' @examples
#' finfo(iris, 5)
finfo <- function(df, i){cat("Name: ", names(df)[[i]],
"\nType: ", class(df[[i]]),
"\nLevels:", levels(df[[i]]),
"\nOrdered:", is.ordered(df[[i]]))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.