【发布时间】:2020-04-01 10:12:45
【问题描述】:
我是 RShiny 的新手,我正在尝试复制此模板:https://shiny.rstudio.com/gallery/retirement-simulation.html 我确实有这个模板的代码,但这是一个学习练习。
这是我目前所拥有的:
ui <- fluidPage(
# Title goes here...
titlePanel("Retirement: simulating wealth with random returns, inflation and withdrawals"),
p("Description here..."),
hr(),
# Sidebar layout...
sidebarLayout(
# Sidebar panel...
sidebarPanel(
# Input: Slider for the number of observations to generate ----
sliderInput("n",
"Param 1",
value = 500,
min = 1,
max = 1000),
sliderInput("n",
"Param 2",
value = 500,
min = 1,
max = 1000),
sliderInput("n",
"Param 3",
value = 500,
min = 1,
max = 1000),
sliderInput("n",
"Param 4",
value = 500,
min = 1,
max = 1000)
),
# Main panel...
mainPanel(
# Outputs of any plots...
tabsetPanel(type = "tabs",
tabPanel("Plot", plotOutput("plot"))
)
)
)
)
看起来不错,但我需要像上面的模板一样使滑块居中。非常感谢正确方向的指点!
谢谢,
乔布斯
【问题讨论】:
-
在侧边栏面板中使用
column参数...其他选项是使用box在滑块周围设置框以进行更精细的控制 -
谢谢。我玩过这个,但我不明白列宽 1-12 部分。如何像上面的示例一样让 16 个滑块以 4 x 4 对齐?
标签: r shiny shinydashboard shiny-server shinyjs