1

I'm currently building an application in R-Shiny and having troubles with the location of the graph since I've added tabs to the application. I want to move the graph from the first tab from below the inputs to the right of them. I'm currently getting the following message from R.

bootstrapPage(position =) is deprecated as of shiny 0.10.2.2. The 'position' argument is no longer used with the latest version of Bootstrap. Error in tabsetPanel(position = "right", tabPanel("Drawdown Plot", plotOutput("line"), : argument is missing, with no default

Any help would be greatly appreciated! Code is below

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")),
))
)
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
Rachel
  • 11
  • 1

1 Answers1

0

Try this code -

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)
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
  • Hi Ronak, that doesn't seemed to have worked the graph and table are both still sitting below the inputs for me. When I remove the theme "minty", the graph and table both shift back up to the right of the side bar. Maybe this is where the issue is? – Rachel Jul 16 '21 at 07:53
  • ahh..I see. I think I misunderstood the question earlier. Yes, it seems the theme is conflicting with the mainPanel here. – Ronak Shah Jul 16 '21 at 12:52