我收到这个错误我错了什么
library(RJDBC)
library(dplyr)
library(shiny)
library(ggplot2)
library(scales)
library(shinydashboard)
library(gridExtra)
library(DT)
ggplotly无法解决我无法解决的错误
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)))
})
答案 0 :(得分:0)
您似乎没有将图表包加载到库列表中。试试加载吗?
library(plotly)
答案 1 :(得分:0)
这可能是旧线程,但答案可能会在将来对某人有所帮助。如果您调整窗口大小,似乎有时会随机弹出此问题。这是使用ggplot遇到的同一错误的github问题。