inst/demo_app/www/script/intro.md

shinypivottabler

The great pivottabler package enables pivot tables to be created with just a few lines of R.

The pivottabler package aims to:

All calculations for the pivot tables take place inside R, enabling the use of a wide-range of R functions in the calculation logic, and are optimized with the use of packages dplyr & data.table

shinypivottabler just add a simple and usefull Shiny module to build, visualize, customize and export custom pivot table.

shinypivottabler vs rpivotTable ?

The rpivotTable package is an R htmlwidget visualization library built around the Javascript pivottable library.

PivotTable.js is a Javascript Pivot Table library with drag'n'drop functionality built on top of jQuery/jQueryUI and written in CoffeeScript (then compiled to JavaScript) by Nicolas Kruchten at Datacratic. It is available under an MIT license

rpivotTable is really a great pivot table library with some really cool features such as :

But it's a full Javascript tool, and so all the data are sended to the client, and all computations are done on the client. So it's not a good idea to use rpivotTable with a huge database.

No charts (yet...?) in shinypivottabler but :

Installation

You can install:

devtools::install_github("datastorm-open/shinypivottabler")

Demo application

runApp(system.file("demo_app", package = "shinypivottabler"))

Example

require(shinypivottabler)

# create artificial dataset
data <- data.frame("V1" = sample(c("A", "B", "C", "D"), size = 1000000,
                                 prob = rep(1, 4), replace = T),
                   "V2" = sample(c("E", "F", "G", "H"), size = 1000000,
                                 prob = rep(1, 4), replace = T),
                   "V3" = sample(c("I", "J", "K", "L"), size = 1000000,
                                 prob = rep(1, 4), replace = T),
                   "V4" = sample(c("M", "N", "O", "P"), size = 1000000,
                                 prob = rep(1, 4), replace = T),
                   "V5" = 1:1000000,
                   "V6" = 1000000:1)


server = function(input, output, session) {
  shiny::callModule(module = shinypivottabler,
                    id = "id",
                    data = data,
                    pivot_cols = c("V1", "V2", "V3", "V4"))
}

ui = shiny::fluidPage(
  shinypivottablerUI(id = "id")
)

shiny::shinyApp(ui = ui, server = server)


# more info in documentation : 
?shinypivottabler

img

img

img



Try the shinypivottabler package in your browser

Any scripts or data that you put into this service are public.

shinypivottabler documentation built on Jan. 6, 2023, 5:25 p.m.