#' @title dataframe to DT
#' @description dataframe to DT
#' @param df dataframe
#'
#' @return DT object
#'
#' @examples
#'
#'
#' @rdname my_DT
#' @export
my_DT <- function(df) {
DT::datatable(
df,
extensions = c('Buttons', 'FixedColumns', 'Scroller'),
options = list(
fixedColumns = TRUE,
scrollY = 400,
scrollX = TRUE,
scroller = TRUE,
dom = 'Bfrtip',
buttons = c('colvis', 'copy', 'print', 'csv', 'excel', 'pdf'),
columnDefs = list(list(
targets = c("_all"), visible = TRUE
))
),
filter = 'bottom'
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.