我正在编写一个闪亮的应用程序,在UI中我想要单选按钮并选择输入选项在一行中。
我的ui。 R文件看起来像:
library(shiny)
library(shinydashboard)
dashboardPage(skin = "blue",
dashboardHeader(title = 'Analysis'),
dashboardSidebar(
sidebarMenu(
menuItem("Summary", tabName = "summary", icon=icon("bar-chart"))
)
),
dashboardBody(
tabItems(
tabItem(tabName ="summary",
fluidRow(
radioButtons("radio", "Options",
list("A","B","C"), inline = TRUE, selected = "A"),
selectizeInput("month", "Month", multiple = T, choices = NULL),
selectizeInput("year", "Year", multiple = T, choices = NULL)
)
)
)
)
)
如何在一行(一行)中制作所有三个?
答案 0 :(得分:0)
我根据这篇文章(shiny 4 small textInput boxes side-by-side)中的解决方案修改了ui.R文件,并且能够将所有三个文件放在一行中。
library(shiny)
library(shinydashboard)
dashboardPage(skin = "blue",
dashboardHeader(title = 'Analysis'),
dashboardSidebar(
sidebarMenu(
menuItem("Summary", tabName = "summary", icon=icon("bar-chart"))
)
),
dashboardBody(
tabItems(
tabItem(tabName ="summary",
fluidRow(
column(6, radioButtons("radio", "Options",
list("A","B","C"), inline = TRUE, selected = "A")),
column(3, selectizeInput("month", "Month", multiple = T, choices = NULL)),
column(3, selectizeInput("year", "Year", multiple = T, choices = NULL))
)
)
)
)
)