#' Data frame visualization
#'
#' This function allows a data frame to
#' be viewed and edited via the \code{listviewer} package.
#'
#' @param data A data frame
#' @param edit \code{TRUE} edit the data frame
#'
#' @return \code{htmlwidget}
#' @export
#' @import listviewer
#' @examples
#' visualize_tibble(mtcars)
visualize_tibble <-
function(data, edit = F) {
if (edit) {
json_list <-
listviewer::jsonedit_gadget(data)
} else {
json_list <-
listviewer::jsonedit(data)
}
return(json_list)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.