Hi everybody,
I am having problems to create graphs in shiny App, I can do a plot in my Rstudio session using ggplot.
Problem starts when I try to connect to shiny using this code::
ui<-fluidPage(
selectInput(inputId = "Mercado", label ="Selecciona Mercado:",
choices=as.character(unique(BBDD$mercado))),
selectInput(inputId = "Canal", label ="Selecciona Canal:",
choices=as.character(unique(BBDD$canal))),
tableOutput("contrib")
)
server<-function(input,output){
output$contrib<-renderPlot({
contrib.graph<-(ggplot() + geom_area(aes(y=value,x=Fecha,fill=typecontribution), data = data.to.plot[data.to.plot$groups=="AOc_CAT",],stat="identity",position_stack(reverse = T))+
scale_x_date(date_labels="%Y%m", date_breaks="3 month", expand=c(0,0)) +
ggtitle("AOc_CAT"))
contrib.graph
})
}
shinyApp(ui=ui,server=server)
---------------------------------------------------------------------------------------
first I get this error:
Warning in pngfun(filename = filename, width = width, height = height, res = res, :
unable to allocate bitmap
Warning in pngfun(filename = filename, width = width, height = height, res = res, :
opening device failed
Warning: Error in pngfun: unable to start png() device
[No stack trace available]
--------------------------------------------------------------------------------------
and if I execute this:options(shiny.usecairo=TRUE)
Warning: Error in Cairo: Failed to create Cairo backend!
I have been looking for solutions on google but nothing, I hope someone can giv eme hand
Thanks
Cristofer