View data frames as Shiny pivot tables. This is an alternative to View() to view data frames as summarized data. Additional options include sparklines and charts and multiple data metrics.

rspivot(df = .Last.value, valueName = "value", initCols = "",
  initRows = "", initNest = "", initFilters = list(),
  initPivotValues = "sum", initMetric = list(metric = "Values", series =
  ""), launch.browser = FALSE)

Arguments

df

A data frame flat file to be converted to pivot format. Data should be in "long" format, with a single column of values named value. The function defaults to showing the most recent object made in R.

valueName

Name of series in df containing data values. Defaults to "value". Can also accept an array of strings containing the names of multiple value columns in the data frame.

initCols

Specify the series to be displayed as columns. If blank, defaults to the right-most series in the data frame.

initRows

Specify the series to be displayed as rows. If blank, defaults to the 2nd right-most series in the data frame.

initNest

Specify the series to be displayed as nested rows. If blank, no nested rows are displayed.

initFilters

Optional list of initial filter selections. Leave a series blank or use "Show All" to select all. Pass series names to make.names() to ensure correct use. Alternatively, leave this blank on the intiial run, and use the Save Function feature after manually selecting filters.

initPivotValues

Summary values to display in the pivot table. Default is "sum", showing the total values of the underlying data. Other options are "mean", "median", "min", "max", and "count". Can also accept customize, one-input summary functions.

initMetric

Optional list of the initial data metrics to display, after data is summarized using initPivotValues.

launch.browser

If TRUE, the system's default web browser will be launched automatically after the app is started.

Examples

# NOT RUN {
rspivot(GVAIndustry)

rspivot(iris, valueName = names(iris)[1:4])
# }