R Shiny Application moving graph location

Viewed 169

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")),
))
)
1 Answers

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)
Related