2016-07-01 11 views
1

私は最近Shinyを学び始めて、私の最初の練習アプリを開発しています。何らかの理由で、私のアプリはブラウザウィンドウ全体を占めるわけではありませんが、半分ほどでカットオフされています。ページはまだ出力の残りを見るためにスクロールすることができますが、何らかの理由で倍の高さがあります。以下は私のコードです:光沢のあるアプリはブラウザウィンドウの半分だけです

Screenshot of the Shiny App

UPDATE:ここ

library(foreign) 
library(dplyr) 
library(shiny) 
library(dplyr) 
library(ggplot2) 
library(shinythemes) 

thesis <- read.csv("thesis.csv", stringsAsFactors = T) 

ui <- fluidPage(theme = shinytheme("cerulean"), 

    # Application title 
    titlePanel("Annual Prices by City"), 

    # Sidebar with choice selected 
    sidebarLayout(
    sidebarPanel(
     selectInput("city","City",as.character(thesis$city)), 
     tableOutput("table") 
    ), 

    # Show a time series line plot 
    mainPanel(
     textOutput("cityheader"), 
     plotOutput("plot", width="100%") 

    ) 
) 
) 


server <- function(input, output, session) { 
    df <- reactive({ 
    thesis %>% 
     select(city, year, price) %>% 
     filter(city == input$city) 

    }) 

    output$plot <- renderPlot({ 
    ggplot(df(), aes(x=year, y=price)) + 
     labs(title=input$city, x="Year", y="Annual Avg Price") + 
     geom_line(col="blue") 

    }, height=400, width = 700) 

    output$table <- renderTable({ 
    df() 

    }) 

    output$cityheader <- renderText({ 
    input$city 
    }) 

} 

shinyApp(ui=ui,server=server) 

は、ホワイトスペースのスクリーンショットです

ここではRstudioで視聴者のペイン内から次のようになります。

Rstudio Screenshot

ありがとう。

+0

を試してみてくださいそれはどのようにRstudio以内に見えますか? – zacdav

+0

Rstudioのスクリーンショットで更新しました。 – Easthaven

答えて

1

私は同じ問題を持っていた、

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

それはそれを修正しました。ありがとう! – Easthaven

関連する問題