https://github.com/retowyss/appifyr
Write R Get Apps!
https://github.com/retowyss/appifyr
knitr opencpu r rmarkdown
Last synced: 10 months ago
JSON representation
Write R Get Apps!
- Host: GitHub
- URL: https://github.com/retowyss/appifyr
- Owner: retowyss
- License: other
- Created: 2017-10-22T11:04:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-05-04T16:30:50.000Z (12 months ago)
- Last Synced: 2025-05-04T16:32:34.738Z (12 months ago)
- Topics: knitr, opencpu, r, rmarkdown
- Language: R
- Homepage: https://retowyss.github.io/appifyr
- Size: 3.12 MB
- Stars: 11
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# appifyr
[](https://github.com/retowyss/appifyr/actions?query=workflow%3AR-CMD-check)
[](https://github.com/retowyss/appifyr/actions?query=workflow%3Apkgdown)
[](https://github.com/retowyss/appifyr/actions?query=workflow%3Atest-coverage)
## Create Web Applications from R Functions (Updated May 4, 2025)
**Turn your R functions into interactive web applications with minimal code!**
appifyr bridges the gap between R's analytical capabilities and web interfaces by:
1. Taking regular R functions
2. Automatically generating HTML forms for function parameters
3. Connecting these inputs to OpenCPU API calls
4. Displaying the function outputs (currently plots)
## Quick Start
```r
# Install the package
install.packages("remotes")
remotes::install_github("retowyss/appifyr")
# Create a simple function
histogram_app <- function(n, bins) {
hist(rnorm(n), breaks = bins, main = "Random Normal Distribution")
}
# Create a web interface for your function
library(appifyr)
app <- appify(
f = "histogram_app",
inps = list(
n = inp_number(from = 10, to = 1000, label = "Sample Size"),
bins = inp_number(from = 5, to = 30, label = "Number of Bins")
)
)
# To run the app, you'll need OpenCPU
# install.packages("opencpu")
# opencpu::ocpu_start_app("YourPackageName")
```
## How It Works
appifyr uses OpenCPU as a backend to create web interfaces for R functions. Unlike Shiny, which requires learning Shiny-specific syntax, appifyr works with regular R functions and requires minimal JavaScript/HTML knowledge.
### Differences from Shiny
* **Shiny**: You start with the goal of creating a specific app and write R code to achieve that goal.
* **appifyr**: You start with existing R code and create an app to visualize your function.
## Documentation and Examples
* [Appifyr Documentation](https://retowyss.github.io/appifyr/)
* [Demo App - Sepals and Petals](http://retowyss.ocpu.io/sepals-and-petals/www/)
## Running Apps
To run apps created with appifyr, you need OpenCPU:
```r
# Install OpenCPU
install.packages("opencpu")
# Clone the demo application
# git clone https://github.com/retowyss/sepals-and-petals.git
# Build and start the app
appifyr::build_app()
opencpu::ocpu_start_app("SepalsAndPetals")
```
## Key Features
* Simple API: The main function `appify()` takes an R function and specifications for inputs
* Intuitive Input Creation: Helper functions like `inp_text()`, `inp_number()`, and `inp_dropdown()`
* Built-in Web Components: Generates Bootstrap-styled form elements and layout
* Integration with OpenCPU: Uses the OpenCPU JavaScript library to handle API calls
## Requirements
* R ≥ 4.1.0
* OpenCPU for running the apps