0

I have two graphs, which I plot together via grid.arrange() then I decide to add a Table with descriptive statistics to the same Panel. However, this table is plotted on the graph, how can I fix this issue and set the table's location whatever the place I want?

how the output looks:

enter image description here

My code:

ui <- fluidPage(
  
  # Application title
  titlePanel("Day-ahead prices"),
  
  # Sidebar with slider input to select date range
  sidebarLayout(
    sidebarPanel(
      selectInput("Region_selector",
                  "Area:",
                  c("SYS","SE1","SE2","SE3","SE4","FI", "DK1","DK2","Oslo","Kr.sand","Bergen","Molde","Tr.heim", "Troms","EE", "LV", "LT", "AT","BE", "DE-LU","FR", "NL")),
      
      # Add a Slider Input to select date range
      #sliderInput
      dateRangeInput("Date_range_selector", "Select Date Range",
                     start = as.Date("2016-01-01","%Y-%m-%d"),
                     end = as.Date("2020-12-01","%Y-%m-%d"),
                     
                     #min = as.Date("2020-10-01","%Y-%m-%d"),
                     #max = as.Date("2020-12-01","%Y-%m-%d"),
                     #value=c(as.Date(Sys.Date()-14),as.Date(Sys.Date())),
                     #format ="%Y-%m-%d"
                     ),
      radioButtons("dist", "Hourly_data:",
                   c("Daily" = "Daily",
                     "Hourly" = "Hourly"))
    ),
    
    # plot graphs
    mainPanel(tabsetPanel(
      tabPanel("Plot", 
               h3(helpText("Nordpool prices")),
               plotOutput("plot"),
               h3(helpText("Descr.statistics")),
               verbatimTextOutput("shap")) ,
      tabPanel("Stat",verbatimTextOutput("shap2"))
    )
  )
))

Phil
  • 7,287
  • 3
  • 36
  • 66
Epo Luusk
  • 37
  • 5
  • 1
    Try adding `fluidRow()` to wrap around the two `tabsetPanels()` functions in your ui section. – Phil Oct 14 '20 at 14:24

1 Answers1

0

I guess (your code is unfortunately not a reprex) the best way is to add a dataDatableOutput in the place you want and to render the output there.

If you shared your server function and data, I could be more specific.

thothal
  • 16,690
  • 3
  • 36
  • 71