changeRow | R Documentation |
Asks to change a row.
changeRow(id, rowIndex, newValues)
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). |
No return value, called from shiny applications for side effects.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.