2017-07-28 4 views
0

ich diese Störung erhalte, was ich bin dong falschkeine anwendbare Methode für ‚ggplotly‘ angewendet auf ein Objekt der Klasse „NULL“

library(RJDBC) 
library(dplyr) 
library(shiny) 
library(ggplot2) 
library(scales) 
library(shinydashboard) 
library(gridExtra) 
library(DT) 

ggplotly funktioniert nicht, was ich falsch nicht in der Lage tue es

zu bekommen
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))) 

     }) 

Antwort

0

Es scheint nicht wie Sie das Plotly-Paket in Ihrer Bibliotheksliste geladen. Versuchen Sie es zu laden?

library(plotly) 
+0

ich vergaß zu erwähnen, aber es ist da –

+0

kann mir jemand mitteilen, warum dieser Fehler –

+0

geschieht Es kann verions Inkonsistenz sein :) – pari

Verwandte Themen