-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Great project! I am going to paste the solution here just in case someone experiences the same issue in the future.
Here is the solution:
# Set global encoding to UTF-8
options(encoding = "UTF-8")
# Load the necessary packages
library("BayesianPredictiveFutility") # Load the package for the Shiny application
library("shiny") # Load the Shiny package for running the application
# Get the path of the Shiny application inside the 'BayesianPredictiveFutility' package
# `system.file()` automatically finds the location of the specified file or directory
# within the installed package, so it converts the relative path to an absolute path.
appDir <- system.file("[find relative path of App.R inside the package]", package = "BayesianPredictiveFutility")
# Check if the path is correct
if (appDir == "") {
stop("Could not find the example directory. Please try reinstalling the `BayesianPredictiveFutility` package.", call. = FALSE)
# call = FALSE means that the error message will not include the line number of the stop() function
} else {
cat("Example path found: \n", appDir, "\n") # Print the path to the console if found
}
# Run the Shiny application
shiny::runApp(appDir, launch.browser = TRUE) # Launch the app in the default browser
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
