This module gives a way to manipulate dataframes by changing column names and column classes. Also, datasets can be filtered based on user inputs.

variableView(input, output, session, dataset, dataName = "dat")

variableViewUI(id)

selectedVar(id)

Arguments

input, output, session

Standard module parameters.

dataset

A reactive table (for example a data.frame)

dataName

A character of length one giving the name of the dataset.

id

The id of the module.

Value

A reactive string representing the code to transform the dataset.

Details

selectedVar is an optional ui element which will show a summary of the variable selected in variableViewUI.

Examples

if (FALSE) { library(DT) data("tips", package = "reshape2") data("diamonds", package = "ggplot2") shinyApp( fluidPage( column(6, selectInput("dataset", "choose dataset", choices = c("mtcars", "tips", "diamonds")), variableViewUI("vv")), column(6, codeOutput("code"), selectedVar("vv"), DTOutput("filtered")) ), function(input, output, session){ dataset <- reactive({get(input$dataset)}) code <- callModule(variableView, "vv", dataset) output$code <- renderCode({ code() }) output$filtered <- renderDT({ dat <- isolate(dataset()) eval(parse(text = code())) dat }) }, options = list(launch.browser = TRUE) ) }