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()) {
   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("The slider controls the new value to assign to the '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 April 12, 2022, 9:06 a.m.