| surreal_app | R Documentation |
Opens an interactive Shiny application for exploring the surreal algorithm. The app allows you to generate datasets with hidden images in residual plots using demo data, custom text, or uploaded images.
surreal_app(launch.browser = TRUE, port = NULL, host = "127.0.0.1")
launch.browser |
Logical. If |
port |
Integer. The port to run the app on. If |
host |
Character. The host address. Default is |
The app provides:
Demo datasets (Jack-o-Lantern, R Logo)
Custom text input to embed messages in residual plots
Image upload support (PNG, JPEG, BMP, TIFF, SVG)
Interactive controls for R², predictors, and image processing settings
Dark/light mode toggle
Data export to CSV
This function is called for its side effect of launching the Shiny app. It does not return a value.
The app requires the shiny and bslib packages to be installed. For image uploads, additional packages may be needed depending on the format:
JPEG: jpeg
BMP: bmp
TIFF: tiff
SVG: rsvg
surreal() for the core algorithm.
surreal_text() for embedding text programmatically.
surreal_image() for processing images programmatically.
## Not run:
# Launch the app in the default browser
surreal_app()
# Launch on a specific port
surreal_app(port = 3838)
# Get the app without launching browser
surreal_app(launch.browser = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.