grid_summary {toastui} | R Documentation |
Add summary area to grid
Description
Add summary area to grid
Usage
grid_summary(
grid,
columns,
stat = c("sum", "min", "max", "avg"),
digits = 0,
label = NULL,
sep = "<br>",
position = c("bottom", "top"),
height = 40,
js_function = NULL
)
Arguments
grid |
A table created with |
columns |
Name of column (variable name) for which to add a summary. |
stat |
Statistic to display: |
digits |
Number of digits to display. |
label |
Label to display next to statistic. |
sep |
Separator between several statistics. |
position |
The position of the summary area: |
height |
The height of the summary area. |
js_function |
JavaScript function to compute the statistic you want.
Function should have one argument, it will be the values of the column.
If used, |
Value
A datagrid
htmlwidget.
Examples
library(toastui)
# Add a line with sum of column
datagrid(ps3_games[, c(1, 5, 6, 7, 8)], colwidths = "guess") %>%
grid_summary(
column = "NA_Sales",
stat = "sum"
)
# Do that for several columns
datagrid(ps3_games[, c(1, 5, 6, 7, 8)], colwidths = "guess") %>%
grid_summary(
column = c("NA_Sales", "EU_Sales", "JP_Sales", "Other_Sales"),
stat = "sum",
label = "Total: "
)
[Package toastui version 0.3.3 Index]