library(shiny)

# Set the path to the R Markdown file
file <- 'IPE.Rmd'

# Set the directory containing the R Markdown file
dir <- dirname(file)

ui <- rmarkdown:::rmarkdown_shiny_ui(dir = dir, file = file)

# Create a list of arguments to pass to the rmarkdown_shiny_server function
render_args <- list()
render_args$envir <- parent.frame()

# Create the Shiny server function by calling the rmarkdown_shiny_server function
server <- rmarkdown:::rmarkdown_shiny_server(dir = dir, file = file, auto_reload = TRUE, render_args = render_args)

# Run the Shiny app
shiny::shinyApp(ui, server)
