0
I have some graphics ready generated by the ggplot package and am trying to build a Rdashboard Shiny and take advantage of these visual products. However, it is being much more complicated than I imagined, I keep getting a lot of errors, as I should refer my ggplot objects ready on the back.end of Shiny Dash board?
I’ll put a piece of the Dash script to better illustrate the situation.
"scriptsimp" is an object that refers to the name of the script file that generates the graphics by ggplot "SS_GRAPH" is the name of a graphical object created by ggplot
library(shiny)
library(shinydashboard)
library(plotly)
source(scriptsimp)
ui <- dashboardPage(
dashboardHeader(title = 'SIM-P'),
dashboardSidebar(
menuItem("Geral", tabName = "Geral"),
menuItem("2020", tabName = "2020"),
menuItem("2021", tabName = "2021")
),
dashboardBody(tabItem(
tabName = 'Geral',
fluidRow(plotOutput("ss"))
)
)
)
source(scriptsimp)
server <- function(input, output) {
output$ss <-renderPlotly({SS_GRAPH)}
Unfortunately, this question cannot be reproduced by anyone trying to answer it. Please take a look at this link (mainly in the use of function
dput
) and see how to ask a reproducible question in R. So, people who wish to help you will be able to do this in the best possible way.– Marcus Nunes