r - no applicable method for 'ggplotly' applied to an object of class "NULL" -
i getting error dong wrong
library(rjdbc) library(dplyr) library(shiny) library(ggplot2) library(scales) library(shinydashboard) library(gridextra) library(dt)
ggplotly not working doing wrong not able
output$plot1 <- renderplotly({ if (is.null(input$sector) ){return() } else if(input$sector == "pick one") { return() } else p1 <-**ggplotly**(ggplot(data = subdata1() ,aes(x=saledate,y=total))+ geom_point(stat='summary', fun.y=sum) + geom_line(colour = "red")+geom_hline(aes(yintercept = mean(total)),colour = "blue")+ geom_text(data = subdata1(), aes(label = total), position=position_jitter(width=1,height=0.8), size=3)))+ scale_y_continuous(labels = scales::comma) labs(x = "saledate", y = "total") print(p1 + theme(axis.text.x = element_text(size = 10,angle = 45,hjust = 1,vjust = 1))) })
it doesn't seem loaded plotly package in library list. try loading it?
library(plotly)
Comments
Post a Comment