I'm using the RStudio IDE to develop shiny apps. When starting an app I usually use the RunApp Button: Run in Window. This opens the app in a window with specific width and height.
Is there a way to change the width of this window, so every time I start the app will be shown in a wider window?
You can try the runGadget option:
library(shiny)
ui <- fluidPage(
titlePanel("Hello Shiny!"),
sidebarLayout(
sidebarPanel(sliderInput(inputId = "bins", label = "Number of bins:", min = 1, max = 50, value = 30)),
mainPanel(plotOutput(outputId = "distPlot"))
)
)
server <- function(input, output) {
output$distPlot <- renderPlot({
x <- faithful$waiting
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = "#75AADB", border = "white",
xlab = "Waiting time to next eruption (in mins)",
main = "Histogram of waiting times")
})
}
# Run in a dialog within R Studio
runGadget(ui, server, viewer = dialogViewer("Dialog Title", width = 1200, height = 600))
# Run in Viewer pane
runGadget(ui, server, viewer = paneViewer(minHeight = 500))
# Run in browser
runGadget(ui, server, viewer = browserViewer(browser = getOption("browser")))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With