Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curso-r/shinyhttr
Give httr::progress the ability to talk to shinyWidgets::progressBar.
https://github.com/curso-r/shinyhttr
httr r rstats shiny
Last synced: about 2 months ago
JSON representation
Give httr::progress the ability to talk to shinyWidgets::progressBar.
- Host: GitHub
- URL: https://github.com/curso-r/shinyhttr
- Owner: curso-r
- License: other
- Created: 2019-01-02T01:37:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-09T02:34:27.000Z (over 4 years ago)
- Last Synced: 2024-11-07T19:22:58.369Z (2 months ago)
- Topics: httr, r, rstats, shiny
- Language: R
- Homepage:
- Size: 50.8 KB
- Stars: 34
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - curso-r/shinyhttr - Give httr::progress the ability to talk to shinyWidgets::progressBar. (R)
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# shinyhttr
[![Travis build status](https://travis-ci.org/curso-r/shinyhttr.svg?branch=master)](https://travis-ci.org/curso-r/shinyhttr) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/curso-r/shinyhttr?branch=master&svg=true)](https://ci.appveyor.com/project/curso-r/shinyhttr) [![CRAN status](https://www.r-pkg.org/badges/version/shinyhttr)](https://cran.r-project.org/package=shinyhttr) [![CRAN downloads](https://cranlogs.r-pkg.org/badges/shinyhttr)](https://cran.r-project.org/package=shinyhttr)
The goal of shinyhttr is to integrate `httr::progress` with `shinyWidgets::progressBar`.
In practice, the difference will be
```{r, eval=FALSE}
# from this
httr::GET("http://download.com/large_file.txt",
progress())# to this
httr::GET("http://download.com/large_file.txt",
progress(session, id = "my_progress_bar1"))
```![gif_progress_example.gif](man/figures/README-gif_progress_example.gif)
## Installation
From CRAN:
```{r, eval=FALSE}
install.packages("shinyhttr")
```From github:
```{r, eval=FALSE}
devtools::install_github("curso-r/shinyhttr")
```## Example
```{r, eval=FALSE}
library(shiny)
library(shinyWidgets)
library(httr)
library(shinyhttr)ui <- fluidPage(
sidebarLayout(
NULL,
mainPanel(
actionButton('download', 'Download 100MB file...'),
tags$p("see R console to compare both progress bars."),
progressBar(
id = "pb",
value = 0,
title = "",
display_pct = TRUE
)
)
)
)server <- function(input, output, session) {
observeEvent(input$download, {
GET(
url = "https://speed.hetzner.de/100MB.bin",
shinyhttr::progress(session, id = "pb") # <- the magic happens here. progress() now has session and id args
)
})
}shinyApp(ui, server)
```