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)
input, output, session | Standard module parameters. |
---|---|
dataset | A |
dataName | A |
id | The id of the module. |
A reactive string representing the code to transform the dataset.
selectedVar
is an optional ui element which will show a summary of the
variable selected in
variableViewUI
.
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) ) }