| Title: | Export 'Shiny' Applications as Desktop Apps using 'Electron' |
|---|---|
| Description: | Provides tools to export 'Shiny' applications written in 'R' or 'Python' as standalone desktop applications using 'Electron'. The applications run as native, cross-platform programs. Depending on the runtime strategy chosen, end users do not need 'R' or 'Python' installed on their machine. |
| Authors: | James Joseph Balamuta [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-2826-8458>) |
| Maintainer: | James Joseph Balamuta <[email protected]> |
| License: | AGPL (>= 3) |
| Version: | 0.2.1 |
| Built: | 2026-09-30 06:58:52 UTC |
| Source: | https://github.com/coatless-rpkg/shinyelectron |
Validates that a Shiny application can be built as an Electron app. Checks app structure, configuration, build targets, runtime availability, dependencies, and signing credentials. Reports issues without aborting.
app_check( appdir = ".", app_type = NULL, runtime_strategy = NULL, platform = NULL, sign = NULL, verbose = TRUE )app_check( appdir = ".", app_type = NULL, runtime_strategy = NULL, platform = NULL, sign = NULL, verbose = TRUE )
appdir |
Character string. Path to the app directory. Default ".". |
app_type |
Character string or NULL. App type override.
If NULL, reads from config or autodetects from files in |
runtime_strategy |
Character string or NULL. Runtime strategy override. |
platform |
Character vector or NULL. Target platforms override. If
NULL, uses |
sign |
Logical or NULL. Signing override. |
verbose |
Logical. Whether to print the report. Default TRUE. |
Files named in _shinyelectron.yml, such as icon or splash.image, are
looked up relative to appdir, as export() does. A missing icon is an
error, because export() stops on it; other missing files are warnings.
So is an icon that a target platform cannot use, because of its format or
the size of its image, since that platform's build shows the default
Electron icon, and an icons entry that the build leaves out, since it
gives one icon to every target platform.
Invisible list with:
pass |
Logical. TRUE if no errors found. |
errors |
Character vector of fatal issues. |
warnings |
Character vector of non-fatal issues. |
info |
Character vector of informational notes. |
# Check a bundled example app app_check(example_app("r")) # Check with explicit overrides app_check(example_app("r"), app_type = "r-shiny", runtime_strategy = "system")# Check a bundled example app app_check(example_app("r")) # Check with explicit overrides app_check(example_app("r"), app_type = "r-shiny", runtime_strategy = "system")
Scans a Shiny app's source for the R or Python packages it uses, with the
same detection shinyelectron applies at build time. This is useful before a
shinylive build, in CI especially, because shinylive::export() compiles the
WebAssembly bundle from the packages installed in the current session, so an
app's dependencies must be installed before conversion.
app_dependencies(appdir, app_type = NULL)app_dependencies(appdir, app_type = NULL)
appdir |
Character string. Path to the app or multi-app suite directory. |
app_type |
Character string or |
Character vector of detected package names, excluding base R packages (for R) or the Python standard library (for Python).
# Detect the packages a bundled example app uses app_dependencies(example_app("r"))# Detect the packages a bundled example app uses app_dependencies(example_app("r"))
Shows all bundled example applications with their descriptions.
available_examples()available_examples()
A data frame with columns: name (character ID),
language ("r" or "python"), type (app type, "r-shiny" or
"py-shiny"), and description (human-readable summary).
available_examples()available_examples()
Builds a distributable Electron application from a converted Shiny app. Creates platform-specific installers and executables.
build_electron_app( app_dir, output_dir, app_name = NULL, app_type = "r-shiny", runtime_strategy = "shinylive", sign = FALSE, platform = NULL, arch = NULL, icon = NULL, config = NULL, overwrite = FALSE, verbose = TRUE )build_electron_app( app_dir, output_dir, app_name = NULL, app_type = "r-shiny", runtime_strategy = "shinylive", sign = FALSE, platform = NULL, arch = NULL, icon = NULL, config = NULL, overwrite = FALSE, verbose = TRUE )
app_dir |
Character string. Path to the converted Shiny/shinylive application. |
output_dir |
Character string. Path where the built Electron app will be saved. |
app_name |
Character string. Name of the application. If NULL, uses the name of the app_dir directory. |
app_type |
Character string. Language of the Shiny app: |
runtime_strategy |
Character string. Runtime strategy: |
sign |
Logical. Whether to enable code signing for the built application. Default is FALSE. |
platform |
Character vector. Target platforms: "win", "mac", "linux". If NULL, builds for current platform.
The |
arch |
Character vector. Target architectures: "x64", "arm64". If NULL, uses current architecture.
The |
icon |
Character string. Path to application icon file, absolute or
relative to the working directory. A PNG (1024x1024 or larger) or an
|
config |
List. Configuration from _shinyelectron.yml file (optional). Used for
template variables like window dimensions, port, and app version. File
paths in it, such as |
overwrite |
Logical. Whether to overwrite existing output directory. Default is FALSE. |
verbose |
Logical. Whether to display detailed progress information. Default is TRUE. |
Character string. Path to the built Electron application directory.
This function creates a complete Electron application by:
Setting up the Electron project structure
Copying application files and templates
Installing npm dependencies
Building platform-specific distributables
# Build Electron app for current platform build_electron_app( app_dir = "path/to/shinylive/app", output_dir = "path/to/electron/build", app_name = "My Shiny App", app_type = "r-shiny" ) # Build for multiple platforms build_electron_app( app_dir = "path/to/app", output_dir = "path/to/build", app_name = "My App", app_type = "r-shiny", platform = c("win", "mac", "linux") )# Build Electron app for current platform build_electron_app( app_dir = "path/to/shinylive/app", output_dir = "path/to/electron/build", app_name = "My Shiny App", app_type = "r-shiny" ) # Build for multiple platforms build_electron_app( app_dir = "path/to/app", output_dir = "path/to/build", app_name = "My App", app_type = "r-shiny", platform = c("win", "mac", "linux") )
Removes cached R installations and/or npm packages from the cache directory.
cache_clear(what = c("all", "r", "npm", "nodejs", "python"))cache_clear(what = c("all", "r", "npm", "nodejs", "python"))
what |
Character string specifying what to clear. One of
|
Invisibly returns NULL.
Use this function to free disk space or force re-downloading of assets:
"r": Removes only cached R installations
"npm": Removes only cached npm packages
"nodejs": Removes only cached Node.js installations
"python": Removes only cached Python installations
"all": Removes all cached assets
If the cache directory doesn't exist, a message is shown and nothing is done.
# Clear everything in the cache cache_clear() # Clear only R installations cache_clear("r") # Clear only npm packages cache_clear("npm") # Clear only Node.js installations cache_clear("nodejs") # Clear only Python installations cache_clear("python")# Clear everything in the cache cache_clear() # Clear only R installations cache_clear("r") # Clear only npm packages cache_clear("npm") # Clear only Node.js installations cache_clear("nodejs") # Clear only Python installations cache_clear("python")
Returns the path where shinyelectron stores downloaded runtimes
(R, Python, Node.js) and other cached assets. By default, the
directory is created if it doesn't already exist. Pass
create = FALSE to query the path without side effects.
cache_dir(create = TRUE)cache_dir(create = TRUE)
create |
Logical. Whether to create the directory if it doesn't exist. Default is TRUE. |
Character string. Absolute path to the cache directory,
typically ~/.cache/shinyelectron/assets on Linux,
~/Library/Caches/shinyelectron/assets on macOS, or
\%LOCALAPPDATA\%/shinyelectron/shinyelectron/Cache/assets on Windows.
Cached runtimes are organized by type, platform, architecture, and version:
assets/ |-- r/ | |-- win/x64/4.5.3/ | |-- mac/arm64/4.5.3/ |-- python/ | |-- win/x64/3.14.6/ | |-- mac/arm64/3.14.6/ |-- nodejs/ | |-- v22.11.0/darwin-arm64/ | |-- v22.11.0/win-x64/
Use cache_info() to see what's actually installed with disk usage.
cache_info() to see what's cached, cache_clear() to
remove cached assets, cache_remove() to remove a specific version.
# Query the cache path without creating it cache_dir(create = FALSE) # Get or create the cache directory (writes to the user cache dir) if (interactive()) { cache_dir() }# Query the cache path without creating it cache_dir(create = FALSE) # Get or create the cache directory (writes to the user cache dir) if (interactive()) { cache_dir() }
Lists all cached runtimes (R, Python, Node.js) with their versions,
platforms, architectures, and disk usage. Modeled after
shinylive::assets_info().
cache_info(quiet = FALSE)cache_info(quiet = FALSE)
quiet |
Logical. If TRUE, suppresses console output and returns the results invisibly. Default is FALSE. |
A data frame (returned invisibly) with columns:
runtime (character), version (character),
platform (character), arch (character),
size (character, human-readable), and path (character).
cache_clear() to remove cached assets, cache_dir() for
the cache location.
# Programmatic access (safe to run -- just inspects the cache dir) df <- cache_info(quiet = TRUE) nrow(df) # number of cached runtimes # Pretty-print the cache contents cache_info()# Programmatic access (safe to run -- just inspects the cache dir) df <- cache_info(quiet = TRUE) nrow(df) # number of cached runtimes # Pretty-print the cache contents cache_info()
Removes a single cached runtime version instead of clearing the
entire cache. Use cache_info() to see what's available.
cache_remove(runtime, version, platform = NULL, arch = NULL)cache_remove(runtime, version, platform = NULL, arch = NULL)
runtime |
Character string. One of |
version |
Character string. Version to remove (e.g., |
platform |
Character string. Platform ( |
arch |
Character string. Architecture ( |
Invisibly returns TRUE if removed, FALSE if not found.
cache_info() to list cached versions, cache_clear() to
remove all cached assets of a type.
# Remove a specific R version cache_remove("r", "4.4.0", "mac", "arm64") # Remove a cached Python version cache_remove("python", "3.14.6", "win", "x64") # Remove one platform/arch slot of a Node.js version cache_remove("nodejs", "v22.11.0", "mac", "arm64")# Remove a specific R version cache_remove("r", "4.4.0", "mac", "arm64") # Remove a cached Python version cache_remove("python", "3.14.6", "win", "x64") # Remove one platform/arch slot of a Node.js version cache_remove("nodejs", "v22.11.0", "mac", "arm64")
Reports the current auto-update configuration status.
check_auto_update_status(appdir)check_auto_update_status(appdir)
appdir |
Character path to app directory |
Invisibly returns the updates configuration list, which is always
present because read_config() deep-merges defaults. Elements include
enabled (logical, FALSE by default when auto-updates have never been
enabled), provider (character), check_on_startup, auto_download,
auto_install (logical), and, for the GitHub provider, github (a list
with owner, repo, private).
# Check update configuration on a temporary app app <- file.path(tempdir(), "check-updates-demo") dir.create(app, showWarnings = FALSE) writeLines("library(shiny)", file.path(app, "app.R")) enable_auto_updates(app, owner = "myusername", repo = "myapp", verbose = FALSE) check_auto_update_status(app)# Check update configuration on a temporary app app <- file.path(tempdir(), "check-updates-demo") dir.create(app, showWarnings = FALSE) writeLines("library(shiny)", file.path(app, "app.R")) enable_auto_updates(app, owner = "myusername", repo = "myapp", verbose = FALSE) check_auto_update_status(app)
Converts a Python Shiny application directory into a shinylive application that can run entirely in the browser using Pyodide.
convert_py_to_shinylive( appdir, output_dir, subdir = NULL, overwrite = FALSE, verbose = TRUE )convert_py_to_shinylive( appdir, output_dir, subdir = NULL, overwrite = FALSE, verbose = TRUE )
appdir |
Character string. Path to the directory containing the Python Shiny application. |
output_dir |
Character string. Path where the converted shinylive app will be saved. |
subdir |
Character or NULL. When set, the app is exported into a |
overwrite |
Logical. Whether to overwrite existing output directory. Default is FALSE. |
verbose |
Logical. Whether to display detailed progress information. Default is TRUE. |
Character string. Path to the converted shinylive application directory.
This function converts a Python Shiny application to shinylive format using the
Python shinylive package. The application will run entirely in the browser
using Pyodide (Python compiled to WebAssembly).
Requirements:
Python 3 must be available on the build machine
The Python shinylive package must be installed (pip install shinylive)
The app directory must contain an app.py file
convert_py_to_shinylive( appdir = "path/to/python/shiny/app", output_dir = "path/to/shinylive/output" )convert_py_to_shinylive( appdir = "path/to/python/shiny/app", output_dir = "path/to/shinylive/output" )
Converts a regular Shiny application directory into a shinylive application that can run entirely in the browser without requiring an R server.
convert_shiny_to_shinylive( appdir, output_dir, subdir = NULL, overwrite = FALSE, verbose = TRUE )convert_shiny_to_shinylive( appdir, output_dir, subdir = NULL, overwrite = FALSE, verbose = TRUE )
appdir |
Character string. Path to the directory containing the Shiny application. |
output_dir |
Character string. Path where the converted shinylive app will be saved. |
subdir |
Character or NULL. When set, the app is exported into a |
overwrite |
Logical. Whether to overwrite existing output directory. Default is FALSE. |
verbose |
Logical. Whether to display detailed progress information. Default is TRUE. |
Character string. Path to the converted shinylive application directory.
This function converts a Shiny application to shinylive format, which allows the application to run entirely in the browser using WebR. The conversion process:
Validates the input Shiny application structure
Converts R code to be compatible with WebR
Creates necessary shinylive configuration files
Packages the application for browser execution
# Convert a Shiny app to shinylive convert_shiny_to_shinylive( appdir = "path/to/shiny/app", output_dir = "path/to/shinylive/output" )# Convert a Shiny app to shinylive convert_shiny_to_shinylive( appdir = "path/to/shiny/app", output_dir = "path/to/shinylive/output" )
Disables automatic update checking in the configuration file.
disable_auto_updates(appdir, verbose = TRUE)disable_auto_updates(appdir, verbose = TRUE)
appdir |
Character path to app directory |
verbose |
Logical whether to show progress messages. Default |
Invisibly returns the path to the updated config file.
# Disable updates on a temporary app app <- file.path(tempdir(), "disable-updates-demo") dir.create(app, showWarnings = FALSE) writeLines("library(shiny)", file.path(app, "app.R")) enable_auto_updates(app, owner = "myusername", repo = "myapp", verbose = FALSE) disable_auto_updates(app)# Disable updates on a temporary app app <- file.path(tempdir(), "disable-updates-demo") dir.create(app, showWarnings = FALSE) writeLines("library(shiny)", file.path(app, "app.R")) enable_auto_updates(app, owner = "myusername", repo = "myapp", verbose = FALSE) disable_auto_updates(app)
Configures automatic update checking for your Electron application. GitHub Releases is the only provider supported today. S3 and Generic HTTP providers are planned and will be added in a future release.
enable_auto_updates( appdir, provider = "github", owner = NULL, repo = NULL, check_on_startup = TRUE, auto_download = FALSE, auto_install = FALSE, verbose = TRUE )enable_auto_updates( appdir, provider = "github", owner = NULL, repo = NULL, check_on_startup = TRUE, auto_download = FALSE, auto_install = FALSE, verbose = TRUE )
appdir |
Character path to app directory containing |
provider |
Character update provider. Currently only |
owner |
Character GitHub username or organization (required for github provider) |
repo |
Character GitHub repository name (required for github provider) |
check_on_startup |
Logical whether to check for updates when app starts. Default |
auto_download |
Logical whether to download updates automatically. Default |
auto_install |
Logical whether to install updates automatically on quit. Default |
verbose |
Logical whether to show progress messages. Default |
Auto-updates require:
A published application (e.g., to GitHub Releases)
Proper code signing for macOS and Windows (recommended)
The electron-updater package (automatically included in build)
GitHub Releases (recommended for open source):
Automatically detects new releases by comparing semver tags
Requires owner and repo parameters
Private repos require GH_TOKEN environment variable
S3 Bucket (planned, not yet supported):
For self-hosted updates behind a CDN
Configure bucket, region, and path in _shinyelectron.yml
Bucket must allow public reads or use CloudFront signed URLs
Required bucket structure: /{path}/latest-mac.yml, latest-linux.yml, latest.yml
Note: enable_auto_updates() currently rejects "s3" as a provider;
S3 support will be added in a future release.
Generic HTTP Server (planned, not yet supported):
For any HTTP server hosting update files
Configure base URL in _shinyelectron.yml
Server must host latest-mac.yml, latest-linux.yml, latest.yml at the URL root
Note: enable_auto_updates() currently rejects "generic" as a provider;
Generic HTTP support will be added in a future release.
After enabling auto-updates, follow this workflow to publish updates:
Bump version in _shinyelectron.yml (e.g., version: "1.1.0")
Rebuild with export(appdir, destdir, build = TRUE)
Create a GitHub Release with a semver tag matching the version:
Tag: v1.1.0 (the v prefix is required)
Upload the built artifacts from destdir/electron-app/dist/:
macOS: .dmg and latest-mac.yml
Windows: .exe installer and latest.yml
Linux: .AppImage and latest-linux.yml
The app checks for updates on startup (if check_on_startup = TRUE)
and notifies the user when a new version is available
macOS and Windows require code-signed builds for auto-updates to work.
Unsigned apps will fail the update verification step. Set
signing: sign: true in your config and provide credentials via
environment variables (see ?validate_signing_config).
Invisibly returns the path to the updated config file.
init_config() for creating initial configuration
# Enable GitHub-based updates on a temporary app app <- file.path(tempdir(), "enable-updates-demo") dir.create(app, showWarnings = FALSE) writeLines("library(shiny)", file.path(app, "app.R")) enable_auto_updates(app, owner = "myusername", repo = "myapp") # Enable with automatic download enable_auto_updates(app, owner = "myorg", repo = "dashboard", auto_download = TRUE)# Enable GitHub-based updates on a temporary app app <- file.path(tempdir(), "enable-updates-demo") dir.create(app, showWarnings = FALSE) writeLines("library(shiny)", file.path(app, "app.R")) enable_auto_updates(app, owner = "myusername", repo = "myapp") # Enable with automatic download enable_auto_updates(app, owner = "myorg", repo = "dashboard", auto_download = TRUE)
Returns the path to a bundled example application directory. Use this
path as the appdir argument to export().
example_app(name)example_app(name)
name |
Character string. Name of the example (see |
Character string. Path to the example app directory.
# Get the path to a bundled example example_app("r") example_app("python") if (interactive()) { # Pass the path to export() to build a desktop app path <- example_app("r") export(path, "output", app_type = "r-shiny", runtime_strategy = "system") }# Get the path to a bundled example example_app("r") example_app("python") if (interactive()) { # Pass the path to export() to build a desktop app path <- example_app("r") export(path, "output", app_type = "r-shiny", runtime_strategy = "system") }
Main entry point function that wraps the conversion, building, and optionally running of a Shiny application as an Electron desktop application.
export( appdir, destdir, app_name = NULL, app_type = NULL, runtime_strategy = NULL, sign = FALSE, platform = NULL, arch = NULL, icon = NULL, overwrite = FALSE, build = TRUE, run_after = FALSE, open_after = FALSE, verbose = TRUE )export( appdir, destdir, app_name = NULL, app_type = NULL, runtime_strategy = NULL, sign = FALSE, platform = NULL, arch = NULL, icon = NULL, overwrite = FALSE, build = TRUE, run_after = FALSE, open_after = FALSE, verbose = TRUE )
appdir |
Character string. Path to the directory containing the Shiny application. |
destdir |
Character string. Path to the destination directory where the Electron app will be created. |
app_name |
Character string. Display name of the application. If NULL,
uses |
app_type |
Character string or NULL. Language of the Shiny app:
|
runtime_strategy |
Character string or NULL. How R or Python reaches
the end user: |
sign |
Logical. Whether to enable code signing for the built application. When TRUE, electron-builder will attempt to sign the app using credentials from environment variables or the config file. Default is FALSE. |
platform |
Character vector. Target platforms: "win", "mac", "linux".
If NULL, uses |
arch |
Character vector. Target architectures: "x64", "arm64". If
NULL, uses |
icon |
Character string. Path to application icon file, absolute or
relative to the working directory. A PNG (1024x1024 or larger) or an
|
overwrite |
Logical. Whether to overwrite existing output directory. Default is FALSE. |
build |
Logical. Whether to build distributable packages. Default is TRUE. |
run_after |
Logical. Whether to run the application in development mode after export. Default is FALSE. |
open_after |
Logical. Whether to open the generated project directory after export. Default is FALSE. |
verbose |
Logical. Whether to display detailed progress information. Default is TRUE. |
List containing paths to the converted app and built Electron app (if built).
This is the main function of the package that orchestrates the entire process:
Validates the input Shiny application
Converts the Shiny app to the specified format (shinylive by default)
Sets up the Electron project structure
Optionally builds distributable packages
Optionally runs the application for testing
Two languages, five delivery strategies.
r-shiny or py-shiny plus runtime_strategy = "shinylive": app compiles to WebAssembly and runs inside the Electron window with no runtime on disk.
r-shiny or py-shiny plus "auto-download", "bundled", "system", or "container": app runs against a real R or Python process supplied by the chosen strategy.
# Simplest call: app_type autodetects, runtime_strategy defaults to shinylive export( appdir = "path/to/shiny/app", destdir = "path/to/electron/output" ) # Run against a real R process instead of shinylive export( appdir = "path/to/shiny/app", destdir = "path/to/output", runtime_strategy = "bundled" ) # Pin language explicitly when autodetection is ambiguous export( appdir = "path/to/shiny/app", destdir = "path/to/output", app_type = "r-shiny", runtime_strategy = "system" )# Simplest call: app_type autodetects, runtime_strategy defaults to shinylive export( appdir = "path/to/shiny/app", destdir = "path/to/electron/output" ) # Run against a real R process instead of shinylive export( appdir = "path/to/shiny/app", destdir = "path/to/output", runtime_strategy = "bundled" ) # Pin language explicitly when autodetection is ambiguous export( appdir = "path/to/shiny/app", destdir = "path/to/output", app_type = "r-shiny", runtime_strategy = "system" )
Creates a template _shinyelectron.yml file in the specified directory.
init_config(appdir, app_name = NULL, overwrite = FALSE, verbose = TRUE)init_config(appdir, app_name = NULL, overwrite = FALSE, verbose = TRUE)
appdir |
Character path to app directory |
app_name |
Character application name. If NULL, derived from directory name. |
overwrite |
Logical whether to overwrite existing config. Default FALSE. |
verbose |
Logical whether to show progress. Default TRUE. |
Invisibly returns the path to the created config file.
wizard() for an interactive configuration generator;
show_config() to display the merged effective configuration.
# Create a config for a temporary app app <- file.path(tempdir(), "init-config-demo") dir.create(app, showWarnings = FALSE) writeLines("library(shiny)", file.path(app, "app.R")) init_config(app, app_name = "My App")# Create a config for a temporary app app <- file.path(tempdir(), "init-config-demo") dir.create(app, showWarnings = FALSE) writeLines("library(shiny)", file.path(app, "app.R")) init_config(app, app_name = "My App")
Downloads and installs Node.js to the shinyelectron cache directory. This allows using Node.js/npm without requiring system-wide installation.
install_nodejs( version = NULL, platform = NULL, arch = NULL, force = FALSE, verbose = TRUE )install_nodejs( version = NULL, platform = NULL, arch = NULL, force = FALSE, verbose = TRUE )
version |
Character Node.js version to install. If NULL (default), automatically detects the latest LTS version. |
platform |
Character target platform ("win", "mac", "linux"). Default is current platform. |
arch |
Character target architecture ("x64", "arm64"). Default is current architecture. |
force |
Logical whether to reinstall if already exists. Default FALSE. |
verbose |
Logical whether to show progress. Default TRUE. |
Invisibly returns the path to the installed Node.js directory.
install_r_portable(), install_python_standalone() for other runtime installers.
# Install latest LTS version install_nodejs() # Install specific version install_nodejs(version = "20.0.0") # Force reinstall install_nodejs(force = TRUE)# Install latest LTS version install_nodejs() # Install specific version install_nodejs(version = "20.0.0") # Force reinstall install_nodejs(force = TRUE)
Downloads and caches a portable Python build from python-build-standalone.
install_python_standalone( version = NULL, platform = NULL, arch = NULL, force = FALSE, verbose = TRUE )install_python_standalone( version = NULL, platform = NULL, arch = NULL, force = FALSE, verbose = TRUE )
version |
Character string. Python version to install (e.g.,
|
platform |
Character string. Target platform. |
arch |
Character string. Target architecture. |
force |
Logical. Whether to reinstall if already cached. |
verbose |
Logical. Whether to show progress. |
Character string. Path to the installed Python directory.
install_r_portable(), install_nodejs() for other runtime installers;
python_executable() to find the installed Python path.
# Install default Python version install_python_standalone() # Install specific version install_python_standalone(version = "3.12.0")# Install default Python version install_python_standalone() # Install specific version install_python_standalone(version = "3.12.0")
Downloads and caches a portable R build. Follows the same pattern
as install_nodejs().
install_r_portable( version = NULL, platform = NULL, arch = NULL, force = FALSE, verbose = TRUE )install_r_portable( version = NULL, platform = NULL, arch = NULL, force = FALSE, verbose = TRUE )
version |
Character string. R version to install. If NULL, installs latest. |
platform |
Character string. Target platform. |
arch |
Character string. Target architecture. |
force |
Logical. Whether to reinstall if already cached. |
verbose |
Logical. Whether to show progress. |
Character string. Path to the installed R directory.
install_python_standalone(), install_nodejs() for other runtime installers;
r_executable() to find the installed Rscript path.
# Install latest R release install_r_portable() # Install specific version for a target platform install_r_portable(version = "4.4.0", platform = "win", arch = "x64")# Install latest R release install_r_portable() # Install specific version for a target platform install_r_portable(version = "4.4.0", platform = "win", arch = "x64")
Launches a previously exported Electron application for testing and debugging
without building distributable packages. Pass the electron-app directory
from a prior export() call.
run_electron_app(app_dir, port = 3000, open_devtools = TRUE, verbose = TRUE)run_electron_app(app_dir, port = 3000, open_devtools = TRUE, verbose = TRUE)
app_dir |
Character string. Path to the Electron application directory
(the |
port |
Integer. Port number for the development server. Default is 3000. |
open_devtools |
Logical. Whether to open Chromium DevTools automatically. Default is TRUE. |
verbose |
Logical. Whether to display detailed progress information. Default is TRUE. |
Invisibly returns the completed processx::run() result list
(with status, stdout, and stderr) after Electron exits, or NULL
if the run is interrupted. Note that this call blocks until the Electron
window is closed.
This function starts the Electron application for testing, which:
Opens the application in an Electron window
Optionally opens Chromium DevTools for debugging
Does NOT build distributable packages (use export(build = TRUE) for that)
# Run a previously exported Electron app in development mode run_electron_app("path/to/electron/app") # Run with custom port and no dev tools run_electron_app( app_dir = "path/to/app", port = 8080, open_devtools = FALSE )# Run a previously exported Electron app in development mode run_electron_app("path/to/electron/app") # Run with custom port and no dev tools run_electron_app( app_dir = "path/to/app", port = 8080, open_devtools = FALSE )
Pretty-prints the merged effective configuration (params + config file + defaults) for a shinyelectron app directory. Useful for debugging and verifying settings.
show_config(appdir = ".")show_config(appdir = ".")
appdir |
Character path to the app directory. |
Invisibly returns the merged configuration list.
# Show the merged configuration for a bundled example app show_config(example_app("r"))# Show the merged configuration for a bundled example app show_config(example_app("r"))
Checks platform-specific build tools required for creating Electron distributables.
sitrep_electron_build_tools(verbose = TRUE)sitrep_electron_build_tools(verbose = TRUE)
verbose |
Logical. Whether to print detailed output. Default is TRUE. |
Invisibly returns a list with build tools information.
# Check build tools sitrep_electron_build_tools()# Check build tools sitrep_electron_build_tools()
Checks R package dependencies required for shinyelectron functionality.
sitrep_electron_dependencies(verbose = TRUE)sitrep_electron_dependencies(verbose = TRUE)
verbose |
Logical. Whether to print detailed output. Default is TRUE. |
Invisibly returns a list with dependency information.
# Check R package dependencies (quiet = returns a list invisibly) deps <- sitrep_electron_dependencies(verbose = FALSE) length(deps$missing_required) # Pretty-printed report sitrep_electron_dependencies()# Check R package dependencies (quiet = returns a list invisibly) deps <- sitrep_electron_dependencies(verbose = FALSE) length(deps$missing_required) # Pretty-printed report sitrep_electron_dependencies()
Checks if the current directory contains a valid Electron project and diagnoses common project-related issues.
sitrep_electron_project(project_dir = ".", verbose = TRUE)sitrep_electron_project(project_dir = ".", verbose = TRUE)
project_dir |
Character. Path to the project directory. Default is current directory. |
verbose |
Logical. Whether to print detailed output. Default is TRUE. |
Invisibly returns a list with project diagnostic information.
# Check the current directory for a shinyelectron project sitrep_electron_project() # Check a specific directory sitrep_electron_project(tempdir())# Check the current directory for a shinyelectron project sitrep_electron_project() # Check a specific directory sitrep_electron_project(tempdir())
Checks system requirements for shinyelectron including Node.js, npm, operating system, and architecture.
sitrep_electron_system(verbose = TRUE)sitrep_electron_system(verbose = TRUE)
verbose |
Logical. Whether to print detailed output. Default is TRUE. |
Invisibly returns a list with diagnostic information.
# Check system requirements sitrep_electron_system() # Get diagnostic info without printing info <- sitrep_electron_system(verbose = FALSE)# Check system requirements sitrep_electron_system() # Get diagnostic info without printing info <- sitrep_electron_system(verbose = FALSE)
Runs all diagnostic checks and provides a comprehensive report of your shinyelectron setup.
sitrep_shinyelectron(project_dir = ".", verbose = TRUE)sitrep_shinyelectron(project_dir = ".", verbose = TRUE)
project_dir |
Character. Path to the project directory to check. Default is current directory. |
verbose |
Logical. Whether to print detailed output. Default is TRUE. |
Invisibly returns a list with all diagnostic information.
# Complete diagnostic check of the current setup sitrep_shinyelectron() # Get results as a list, without printing results <- sitrep_shinyelectron(verbose = FALSE) # Check a specific project directory sitrep_shinyelectron(tempdir())# Complete diagnostic check of the current setup sitrep_shinyelectron() # Get results as a list, without printing results <- sitrep_shinyelectron(verbose = FALSE) # Check a specific project directory sitrep_shinyelectron(tempdir())
Walks through setup questions and generates a _shinyelectron.yml configuration file for your Shiny app.
wizard(appdir)wizard(appdir)
appdir |
Character string. Path to the app directory. |
Invisible path to the generated config file.
init_config() to create a template config file;
show_config() to display the merged effective configuration.
wizard(tempdir())wizard(tempdir())