0

This code creates an interactive radarchart in a shiny app:

library(shiny)
library(radarchart)

ui <- pageWithSidebar(
  headerPanel('Radarchart Shiny Example'),
  sidebarPanel(
    checkboxGroupInput('selectedPeople', 'Who to include', 
                       names(radarchart::skills)[-1], selected="Rich")
  ),
  mainPanel(
    tags$head(tags$script(HTML(js))),
    chartJSRadarOutput("plot1", width = "450", height = "300")
  )
)

server <- function(input, output) {
  output$plot1 <- renderChartJSRadar({
    chartJSRadar(skills[, c("Label", input$selectedPeople)], 
                 maxScale = 10, showToolTipLabel=TRUE) 
  })
}
shinyApp(ui, server)

How can I automatically save the radarchart in a png file into the working directory.

So far it is possible for me to save the radarchart to the local download folder like asked here: chartJSRadar downloadhandler creating empty png.

What I need is to save the reactive radarchart as png and pass it later to Rmarkdown to create a report.

Until now I try to pass the parameter, but that does not work when deployed due to capacity problems. So I thought to pass the png only to Rmarkdown.

TarJae
  • 43,365
  • 4
  • 14
  • 40

0 Answers0