Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcanouil/rshiny
Introduction to the 'shiny' package
https://github.com/mcanouil/rshiny
french introduction presentation-slides r shiny shiny-app slides workshop
Last synced: 20 days ago
JSON representation
Introduction to the 'shiny' package
- Host: GitHub
- URL: https://github.com/mcanouil/rshiny
- Owner: mcanouil
- License: cc-by-sa-4.0
- Created: 2019-07-25T08:13:05.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-11T09:21:34.000Z (about 3 years ago)
- Last Synced: 2024-08-13T07:14:08.529Z (4 months ago)
- Topics: french, introduction, presentation-slides, r, shiny, shiny-app, slides, workshop
- Language: R
- Homepage: https://m.canouil.dev/rshiny/
- Size: 14 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - mcanouil/rshiny - Introduction to the 'shiny' package. (R)
README
---
output: github_document
---# First Steps With The Shiny R Package
[![License](https://img.shields.io/github/license/mcanouil/rshiny)](LICENSE)
This is a workshop for the R package `shiny`.
```{r, include = FALSE}
library(magick)
library(here)
library(chromote)
library(glue)thumb <- "thumbs/title_slide_thumb.png"
png <- sub("_thumb", "", thumb)
index_html <- here::here("docs/index.html")if (!file.exists(thumb) | file.mtime(thumb) < file.mtime(index_html)) {
web_browser <- suppressMessages(try(chromote::ChromoteSession$new(), silent = TRUE))
if (inherits(web_browser, "try-error") && Sys.info()[["sysname"]] == "Windows") {
edge_path <- "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
if (file.exists(edge_path)) {
Sys.setenv(CHROMOTE_CHROME = edge_path)
web_browser <- chromote::ChromoteSession$new()
} else {
stop('Please set Sys.setenv(CHROMOTE_CHROME = "Path/To/Chrome")')
}
}
web_browser$Page$navigate(index_html, wait_ = FALSE)
page_browser <- web_browser$Page$loadEventFired()
Sys.sleep(1)
web_browser$screenshot(
filename = png,
selector = "div.remark-slide-scaler",
scale = 2
)
web_browser$close()
resize <- function(path_in, path_out) {
image <- image_read(path_in)
image <- image_resize(image, "384x")
image_write(image, path_out)
}
resize(png, thumb)
}
```