Skip to content

jankowtf/dtf

Repository files navigation

dtf

Lifecycle: experimental CRAN status

Installation

You can install the development version of from GitHub with:

# install.packages("remotes")
remotes::install_github("rappster/dtf")

What?

An interface to customize DT::datatable() in a structured and composable way

Why?

Because I never seem to be able to remember the exact combination of extensions and options and how they interact.

How?

library(dtf)

Bundle AutoFill

Default

See https://rstudio.github.io/DT/extensions.html (setion 1. AutoFill)

With the AutoFill extension, you will see a blue square in the bottom-right corner of a cell when you mouse over the cell. You can drag it to automatically fill the column.

mtcars %>% datatable2(bundle = dt_bundle_autofill())

mtcars %>% datatable2(bundle = "AutoFill")

Custom options

For comparison when calling DT::datatable()

mtcars %>% DT::datatable(
    extensions = "AutoFill", 
    options = list(
        autoFill = TRUE
    )
)

mtcars %>% datatable2(
    bundles = dt_bundle_autofill(columns = c(1, 2, 3))
)

mtcars %>% datatable2(
    bundles = dt_bundle_autofill(columns = c(1, 2, 3), focus = "click")
)

mtcars %>% datatable2(
    bundles = dt_bundle_autofill(
        columns = c("mpg", "disp"), 
        focus = "click",
        .data = mtcars
    )
)

mtcars %>% datatable2(
    bundles = list(
        dt_bundle_autofill(
            .options = list(columns = c(1, 2, 3), focus = "click")
        )
    )
)

For comparison when calling DT::datatable()

mtcars %>% DT::datatable(
    extensions = "AutoFill", 
    options = list(
        autoFill = list(columns = c(1, 2, 3), focus = "click")
    )
)

Shiny module (experimental!)

mod_render_dt_server(
    id = "my_id",
    output_id = "dt",
    data = mtcars
)

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages