【发布时间】:2016-07-05 19:28:26
【问题描述】:
我是 shiny 的新手,我遇到了一个问题,当网页被切成两半时,我无法查看整个图形和表格。你知道为什么会这样吗?
编辑:我有一个滑块可以在页面上上下移动,但我想以全分辨率查看它。
示例:
t = data.frame(x = sample(c('a1','b1','b2'), size = 720, replace = TRUE),
date = sample(seq(as.Date('2014-01-01'), as.Date('2016-12-01'), by = 'month'), replace = TRUE, size = 720),
tx = runif(720),
ty = runif(720))
ui <- fluidPage(
# App title
titlePanel("Hello"),
# selector for the graph
shiny::selectInput(inputId = 'selector', label = 'Selector'
,choices = unique(t$x))
)
server <- function(input, output) {
output$graph1 <- renderPlot({
ta = t %>% filter(x== input$selector& date >= '2014-01-01') %>%
group_by(date) %>%
summarise(ty = sum(ty)) %>%
ggplot2::ggplot(data = ta)+
geom_line(aes(x = date, y = ty, colour = 'red'))+
theme_bw()
})
}
shinyApp(ui = ui, server = server)
【问题讨论】:
-
什么是
t?此示例不可重现。 -
@PatrickRoocks 对不起,我忘了添加数据框构造。我编辑了我的帖子