1

我目前正在 R-Shiny 中构建一个应用程序,但由于我在应用程序中添加了选项卡,因此在图形位置方面遇到了问题。我想将图表从第一个选项卡从输入下方移动到它们的右侧。我目前从 R 收到以下消息。

bootstrapPage(position =) 自闪亮的 0.10.2.2 起已弃用。'position' 参数不再与最新版本的 Bootstrap 一起使用。tabsetPanel(position = "right", tabPanel("Drawdown Plot", plotOutput("line"), : 参数丢失,没有默认值

任何帮助将不胜感激!代码如下

ui <- fluidPage(
  titlePanel("Drawdown Calculator"),
  theme = bs_theme(version = 4, bootswatch = "minty"),
  sidebarPanel(
    numericInput(inputId = "pot",
                 label = "Pension Pot",
                 value = 500000, min = 0, max = 2000000, step = 10000),
    numericInput(inputId = "with",
                 label = "Withdrawal Amount",
                 value = 40000, min = 0, max = 200000, step = 1000),
    numericInput(inputId = "age",
                 label = "Age", value = 65, max = 90, min = 40),
    sliderInput(inputId = "int",
                label = "Interest",
                value = 4, max = 15, min = 0, step = 0.1)),
  mainPanel(
    tabsetPanel(position = "right",
      tabPanel("Drawdown Plot", plotOutput("line"),
               p("This drawdown calculator calculates a potential drawdown outcome")),
      tabPanel ("Breakdown of Drawdown Withdrawals",
     tableOutput("View")),
))
)
4

1 回答 1

0

试试这个代码 -

library(shiny)
library(bslib)

ui <- fluidPage(
  titlePanel("Drawdown Calculator"),
  theme = bs_theme(version = 4, bootswatch = "minty"),
  sidebarPanel(
    numericInput(inputId = "pot",
                 label = "Pension Pot",
                 value = 500000, min = 0, max = 2000000, step = 10000),
    numericInput(inputId = "with",
                 label = "Withdrawal Amount",
                 value = 40000, min = 0, max = 200000, step = 1000),
    numericInput(inputId = "age",
                 label = "Age", value = 65, max = 90, min = 40),
    sliderInput(inputId = "int",
                label = "Interest",
                value = 4, max = 15, min = 0, step = 0.1)),
  mainPanel(
    tabsetPanel(
      tabPanel("Drawdown Plot", 
                         p("This drawdown calculator calculates a potential drawdown outcome"), 
               tableOutput("View")),
                tabPanel("Breakdown of Drawdown Withdrawals",
                          plotOutput("line"))
))
)

server <- function(input, output) {}

shinyApp(ui, server)
于 2021-07-16T03:33:53.680 回答