【问题标题】:Shiny issues when rendering html page呈现 html 页面时的闪亮问题
【发布时间】: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 对不起,我忘了添加数据框构造。我编辑了我的帖子

标签: r shiny render


【解决方案1】:

我解决了它只是添加

options = list(height = 1080)

在shinyApp命令的最后,如下图:

shinyApp(ui = ui, server = server, options = list(height = 1080))

【讨论】:

    猜你喜欢
    • 2021-09-01
    • 1970-01-01
    • 2016-09-13
    • 2013-10-01
    • 2020-07-27
    • 2020-03-01
    • 2023-03-13
    • 2016-06-09
    • 1970-01-01
    相关资源
    最近更新 更多