library(shiny)
library(plotly)
library(dplyr)
library(scales)
library(reticulate)
source_python("cems_api.py")
ui <- fluidPage(
plotlyOutput("plot")
)
server <- function(input, output) {
# renderPlotly() also understands ggplot2 objects!
output$plot <- renderPlotly({
SO_table$polno <- as.factor(unlist(SO_table$polno))
SO_table$m_time <- as.POSIXct(SO_table$m_time, format="%Y/%m/%d %H:%M")
SO_ggplot<- SO_table %>% ggplot(aes(x = m_time, y = m_val, color=polno)) +
geom_point() +
geom_line()+
theme_bw()+
labs(y="ppm")+
scale_x_datetime(date_labels="%m/%d %H:%M:%S")
SO_linechart <- ggplotly(SO_ggplot)
})
}
shinyApp(ui, server)
警告:isReallyReal:x中的错误必须是double类型。
这是我需要的代码和文件。
https://drive.google.com/open?id=12JPV9AaLfoCBb_VsFJOiDowdQHwOu_Qy