getting error:
output object not found
don't know why this is happening ,i have done the same stuff on past dashboard that time no error occurred. Output object is specified ,but still it cant detect
Server.R
d <-read_excel("data/ds.xlsx",sheet = 1)
output$plot1 <- renderPlotly({
data <- switch(input$var,
"Beginning Stocks (1000 MT)"= d$`Beginning Stocks (1000 MT)`
,"Area Harvested (1000 HA)" = d$`Area Harvested (1000 HA)`
,"Yield (MT/HA)" = d$`Yield (MT/HA)`
,"Production (1000 MT)" = d$`Production (1000 MT)`
,"MY Imports (1000 MT)" =d$`MY Imports (1000 MT)`
)
data1 <- switch(input$var1,
"Beginning Stocks (1000 MT)"= d$`Beginning Stocks (1000
MT)`
,"Area Harvested (1000 HA)" = d$`Area Harvested (1000 HA)`
,"Yield (MT/HA)" = d$`Yield (MT/HA)`
,"Production (1000 MT)" = d$`Production (1000 MT)`
,"MY Imports (1000 MT)" =d$`MY Imports (1000 MT)`
)
plot_ly(d, x =~d$`Attributes (Unit)`, y = ~data,type= "scatter",mode =
'markers+lines', marker = list(size = 10),name=input$var) %>%
add_trace(x = ~d$`Attributes (Unit)`, y = ~data1,type="scatter"
,mode="markers+lines",name=input$var1)
})
UI.R
navbarPage("Barley Dashboard",
tabPanel("Balance sheet",
fluidPage(theme = shinytheme("united"),
mainPanel(fluidRow( column(8,selectInput("var",selected="select",
label = "Choose first variable",
choices = c( "Beginning Stocks (1000 MT)","Area Harvested (1000
HA)","Yield (MT/HA)","Production (1000 MT)","MY Imports (1000
MT)")
)
),
column(8,selectInput("var1", selected = "select",
label = "Choose second variable",choices = c("Beginning Stocks
(1000 MT)", "Area Harvested (1000 HA)","Yield (MT/HA)","Production
(1000 MT)","MY Imports (1000 MT)")
)
)
),
plotlyOutput("plot1")
) ) ) )
getting error :Error in output$plot1 <- renderPlotly({ : object 'output' not found
I am not able to rectify the error

server <- function(input, output, session){- akrunddataframe anywhere... So there's still error from that - Antoine Pissoort