gpt4 book ai didi

R Shiny : Side by Side Checkbox

转载 作者:行者123 更新时间:2023-12-04 01:33:47 26 4
gpt4 key购买 nike

我想知道是否可以在 UI 上并排显示复选框选项。我尝试过的一些示例代码:

shinyUI(pageWithSidebar(
headerPanel("Example"),
sidebarPanel(
checkboxInput(inputId = "simOption", label = "Historical Data",value=TRUE),
checkboxInput(inputId = "simOption2", label = "Historical Data 2",value=TRUE)


),

mainPanel(
tabsetPanel(

tabPanel("Heatmap",
plotOutput("temp")
),
tabPanel("About"),

id="tabs"
)#tabsetPanel

)#mainPane;

))

最佳答案

尝试伪造一些 bootstrap 语法:

shinyUI(pageWithSidebar(
headerPanel("Example"),
sidebarPanel(

withTags(div(class='row-fluid',
div(class='span3', checkboxInput(inputId = "simOption", label = "Historical Data",value=TRUE)),
div(class='span5', checkboxInput(inputId = "simOption2", label = "Historical Data 2",value=TRUE))
))



),

mainPanel(
tabsetPanel(

tabPanel("Heatmap",
plotOutput("temp")
),
tabPanel("About"),

id="tabs"
)#tabsetPanel

)#mainPane;

))

https://medium.com/what-i-learned-building/99fdd6e46586

编辑水平单选按钮

来自 ?radiobutton
radioButtons("dist", "Distribution type:",
c("Normal" = "norm",
"Uniform" = "unif",
"Log-normal" = "lnorm",
"Exponential" = "exp"))

替换为
 gsub("label class=\"radio\"", "label class=\"radio inline\"",radioButtons("dist", "Distribution type:",
c("Normal" = "norm",
"Uniform" = "unif",
"Log-normal" = "lnorm",
"Exponential" = "exp")))
)

关于R Shiny : Side by Side Checkbox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17277210/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com