图形在页面上无法正确显示为闪亮

问题描述 投票:0回答:1

我是新手,我有以下问题。我的情节没有显示在整个页面中。我搜索了fillPage和fluidPage,但无法取得任何进展。我的代码如下:

library(shiny)
library(demography)
library(shinythemes)


ui <-fillPage(


titlePanel("Mortality"),


 sidebarLayout(


sidebarPanel(


  selectInput(inputId = "dataset",
              label = "Choose a dataset:",
              choices = c( "Austria","Belgium","Bulgaria","Czech Republic","Denmark","Finland","France","Germany","Greece","Iceland","Italy","Luxembourg","Netherlands","Portugal","Spain","Sweden","Switzerland","U.K","Ukraine"))



),


mainPanel(


  textOutput("caption", container = span),


  verbatimTextOutput("summary"),



  plotOutput('plot')

    )
    )
   )
    server <- function(input, output) {




 Austria=hmd.mx("AUT",, , "AUT")

datasetInput <- reactive({
    switch(input$dataset,
       "Austria"=Austria,
       "Belgium"=Belgium,
       "Bulgaria"=Bulgaria,
       "Czech Republic"=Czech.Republic,
       "Denmark"=Denmark,
       "Finland"=Finland,
       "France"=France,
       "Germany"=Germany,
       "Greece"=Greece,
       "Iceland"=Iceland,
       "Italy"=Italy,
       "Luxembourg"=Luxembourg,
       "Netherlands"=Netherlands,
       "Portugal"=Portugal,
       "Spain"=Spain,
       "Sweden"=Sweden,
       "Switzerland"=Switzerland,
       "U.K"=U.K)
   })


  output$caption <- renderText({
    input$dataset
   })


  output$summary <- renderPrint({
    dataset <- datasetInput()
   summary(dataset)
  })


 output$plot <- renderPlot({
   dataset <- datasetInput()
   plot(dataset)
   })

   }


  shinyApp(ui, server)

这里是屏幕截图。谢谢您的时间image

PS。在我的代码中,我有其他国家/地区的数据,不仅是奥地利

r plot shiny
1个回答
0
投票

尝试填充页面高度

fillPage(plotOutput(“ plot”,height =“ 100%”))

© www.soinside.com 2019 - 2024. All rights reserved.