Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ketchbrookanalytics/shiny_arrow
Example code representing a real-life use case for using {arrow} to improve a Shiny application
https://github.com/ketchbrookanalytics/shiny_arrow
arrow r rstats shiny
Last synced: about 2 months ago
JSON representation
Example code representing a real-life use case for using {arrow} to improve a Shiny application
- Host: GitHub
- URL: https://github.com/ketchbrookanalytics/shiny_arrow
- Owner: ketchbrookanalytics
- Created: 2021-05-19T15:40:24.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-06T20:38:52.000Z (over 3 years ago)
- Last Synced: 2024-12-01T00:39:17.618Z (2 months ago)
- Topics: arrow, r, rstats, shiny
- Language: R
- Homepage: https://ketchbrookanalytics.shinyapps.io/shiny_arrow/
- Size: 29.3 KB
- Stars: 17
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- jimsghstars - ketchbrookanalytics/shiny_arrow - Example code representing a real-life use case for using {arrow} to improve a Shiny application (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```# {shiny} + {arrow} in R: A Use Case by Ketchbrook Analytics
Shiny apps are an incredible tool for bringing data science to life, communicating your work with non-technical stakeholders, or allowing self-service data exploration for an audience. One of the tricky parts about managing shiny apps is keeping them from taking up a lot of space on the server they are deployed on, especially when it is necessary to include the data as part of the app (as opposed to querying an external database).
As your data becomes *"big"*, moving from traditional record-oriented file types (e.g., *.csv*, *.txt*, etc.) to more modern column-oriented file types (*.parquet*) can drastically reduce the size of the file containing your data. This is where the [{arrow}]() package can help.
The **{arrow}** package provides two major benefits:
1. It has the ability to read & write *.parquet* files (among other file types)
2. You can query the data in that file *before* bringing it into an R data frame, using **{dplyr}** verbs, which provides for dramatic speed improvementsThis repository contains an [example shiny app](app.R) demonstrating how to accomplish this. This app is also [live on shinyapps.io](https://ketchbrookanalytics.shinyapps.io/shiny_arrow/).
## Installation
Perform the following steps to get the shiny app up & running on your desktop:
1. Install the [{renv} package](https://rstudio.github.io/renv/articles/renv.html) by running `install.packages("renv")` in the R console
2. Clone this repository to your desktop
3. Open the **shiny_arrow.Rproj** file from the directory on your local machine where you cloned this repository
4. Run `renv::restore()` to install the package dependencies needed to run this app successfully
5. Run the scripts in the [data-raw](data-raw) directory to generate the mock data
6. Open the [app.R](app.R) file and execute the code in that script to launch the app***
## Session Info
```{r}
sessionInfo()
```