surreal_app: Launch the Surreal Shiny App

View source: R/surreal-app.R

surreal_appR Documentation

Launch the Surreal Shiny App

Description

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.

Usage

surreal_app(launch.browser = TRUE, port = NULL, host = "127.0.0.1")

Arguments

launch.browser

Logical. If TRUE (default), opens the app in the default web browser. If FALSE, returns the app URL for manual opening.

port

Integer. The port to run the app on. If NULL (default), Shiny will choose an available port.

host

Character. The host address. Default is "127.0.0.1" (localhost).

Details

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

Value

This function is called for its side effect of launching the Shiny app. It does not return a value.

Requirements

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

See Also

surreal() for the core algorithm. surreal_text() for embedding text programmatically. surreal_image() for processing images programmatically.

Examples

## 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)


surreal documentation built on Jan. 11, 2026, 9:07 a.m.