2015-01-13 70 views
2

我在R中有一個SelectInput,並且周圍有很多空白區域。這裏是我的ui.r選擇輸入:如何更改R發光中SelectInput周圍區域的寬度

library(shiny) 
shinyUI(pageWithSidebar(
    headerPanel(GetHeader()), 

sidebarPanel(
    selectInput("date", "Select Date:", GetListOfDays(), width="120px") 
    #dateInput("date", "Date:", GetListOfDays()) #value = "2012-02-29") 
), 

    mainPanel(
    uiOutput("plots") 
) 

現在,當我運行報告中,我看到:

enter image description here

你看到所有的空白處選擇輸入的左?我如何修剪或刪除它?

謝謝。

+0

此答案有幫助嗎? http://stackoverflow.com/questions/20343611/how-to-adjust-the-width-of-sidebarpanel-without-affect-subsequent-sidebarpanel-w – maloneypatr

+0

嗨,看編輯,沒有工作,我想因爲我使用pageWithSidebar,他有一個自定義的三頁的東西。 – user3022875

+0

順便說一下,你的意思是所有的空間在右邊?只是想確保我明白這個問題... – maloneypatr

回答

5

看起來好像在函數中有一個width參數。

library(shiny) 
shinyUI(pageWithSidebar(
    headerPanel(GetHeader()), 

    sidebarPanel(
    selectInput("date", "Select Date:", GetListOfDays(), width="120px"), 
    width = 2 ### EDIT HERE 
), 

    mainPanel(
    uiOutput("plots") 
)