changeRow: Row edition

View source: R/parallelPlot.R

changeRowR Documentation

Row edition

Description

Asks to change a row.

Usage

changeRow(id, rowIndex, newValues)

Arguments

id

output variable to read from (id which references the requested plot)

rowIndex

index of the changed row.

newValues

list of new values to attribute to the row (list associating a value to a column identifier).

Value

No return value, called from shiny applications for side effects.

Examples

 if(interactive() && require(shiny)) {
   library(shiny)
   library(parallelPlot)

   ui <- fluidPage(
     sliderInput(
       "rowValueSlider",
       "Value for 'Sepal.Length' of first row:",
       min = 4, max = 8, step = 0.1,
       value = iris[["Sepal.Length"]][1]
     ),
     p("Slider controls the new value to assign to 'Sepal.Length' of the first row"),
     parallelPlotOutput("parPlot")
   )

   server <- function(input, output, session) {
     output$parPlot <- renderParallelPlot({
       parallelPlot(iris)
     })
     observeEvent(input$rowValueSlider, {
       newValues <- iris[1,]
       newValues[["Sepal.Length"]] <- input$rowValueSlider
       parallelPlot::changeRow("parPlot", 1, newValues)
     })
   }

   shinyApp(ui, server)
 }


parallelPlot documentation built on June 22, 2024, 10:47 a.m.