When I go to run any R shiny application the first time it displays properly in the default R studio window. However if I go to run the code again I get a blank screen as shown below and I have to click "Open in Browser" to have it displayed properly. This happens no matter the complexity of the code even with something simple like the code below. The only way of fixing this is if I restart my R Studio entirely.
RStudio 2022.12.0 353 "Elsbeth Geranium" Release
(7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Windows
version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 2.2
year 2022
month 10
day 31
svn rev 83211
language R
version.string R version 4.2.2 (2022-10-31 ucrt)
nickname Innocent and Trusting
library("shiny")
ui <- fluidPage(
checkboxGroupInput(inputId="test", label="Test", choices=1:4, inline = TRUE)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
CodePudding user response:
You can use
shinyApp(ui = ui, server = server,options=c(launch.browser = .rs.invokeShinyPaneViewer))
to force shiny to always render in the viewer pane.