2016-05-08 4 views
0

2 selectInput 1つのライン中の1つのチェックボックスを作成する方法、ディスプレイは次のようになり:シャイニー - 2 selectInput 1つのライン中の1つのチェックボックス

X軸:----- Y軸:--- ---- -check

とコードは次のとおりです。 UI:

library(shiny) 
shinyUI(fluidPage(
    titlePanel("Shiny"), 
    sidebarLayout(
    sidebarPanel(

    ), 
    mainPanel(

     uiOutput("scatcoefgwr") 
    ) 
) 
)) 

サーバー:

shinyServer(function(input, output) { 

    output$scatcoefgwr <- renderUI({ 

    list(

     selectInput("axisx", "x axis:",choices = c("1","2","3")), 
     selectInput("axisy", "y axis:",choices = c("1","2","3")), 
     checkboxInput("scatterD3_ellipsesgwr", "check", value = FALSE) 
    ) 
    }) 

}) 

答えて

1

ここでは列を使用した1つの方法があります。

#ui.R 
library(shiny) 
shinyUI(fluidPage(
    titlePanel("Shiny"), 
    fluidRow(
    column(width=2,uiOutput("one")), 
    column(width=2,uiOutput("two")), 
    column(width=2,uiOutput("three")) 
) 
)) 

必要に応じて幅を変更します。

#server.R 
shinyServer(function(input, output) { 
    output$one <- renderUI({ 
    list(
     selectInput("axisx", "x axis:",choices = c("1","2","3")) 
    ) 
    }) 
    output$two <- renderUI({ 
    list(
     selectInput("axisy", "y axis:",choices = c("1","2","3")) 
    ) 
    }) 
    output$three <- renderUI({ 
    list(
     checkboxInput("scatterD3_ellipsesgwr", "check", value = FALSE) 
    ) 
    }) 
}) 
関連する問題