While trelliscopejs is a very powerful visualization paradigm, it can be hard to munge the data into the appropriate format. This function automatically creates a trelliscopejs visualization populated with pivot tables created by rpivotTable.

precise_pivot(data, rows = NULL, cols = NULL,
  aggregator = "Count as Fraction of Rows", renderer = "Table Barchart",
  parallel = FALSE, verbose = FALSE)

Arguments

data

data.frame or data.table (R>=1.9.6 for safety) with data to use in the pivot table

rows

String name of the column in the data.frame to prepopulate the rows of the pivot table.

cols

String name of the column in the data.frame to prepopulate the columns of the pivot table.

aggregator

String name of the pivottable.js aggregator to prepopulate the pivot table.

renderer

List name of the renderer selected, e.g. Table, Heatmap, Treemap etc.

Value

A trellisopejs object populated by pivot tables.

Details

For the arguments aggregator and renderer see aggregatorName and rendererName arguments from the rpivotTable package. For all other arguments (except the data argument), see the identical arguments in the trelliscopejs package.

References

Muchmore, B., Muchmore P. and Alarcón-Riquelme ME. (2018). Optimal Distance Matrix Construction with PreciseDist and PreciseGraph.

Enzo Martoglio (2018). rpivotTable: Build Powerful Pivot Tables and Dynamically Slice & Dice your Data. R package version 0.3.0. https://CRAN.R-project.org/package=rpivotTable

Examples

library(PreciseDist) test_matrix <- replicate(10, rnorm(100)) test_dists <- test_matrix %>% precise_dist(c("manhattan", "euclidean"))
#> [1] "Starting dists calculations at 2018-11-29 15:20:26" #> [1] "Finished dists calculations at 2018-11-29 15:20:26" #> [1] "Calculations took: 0.51 seconds" #> [1] "Starting dist_funcs calculations at 2018-11-29 15:20:26" #> [1] "Finished dist_funcs calculations at 2018-11-29 15:20:27" #> [1] "Calculations took: 0 seconds"
test_fusion <- test_dists %>% precise_fusion(fusion = "fuse", verbose = TRUE)
#> [1] "Starting distance matrix fusion using fuse at 2018-11-29 15:20:27" #> [1] "Finished distance matrix fusion at 2018-11-29 15:20:27" #> [1] "Fusion took: 0 seconds"