R/my_DT.R

Defines functions my_DT

Documented in my_DT

#' @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'
    )
}
jixing475/manuscriptsJX documentation built on April 20, 2020, 9:55 a.m.