Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mcanouil/rstartup

Tips to start working with R
https://github.com/mcanouil/rstartup

introduction presentation-slides r startup

Last synced: 19 days ago
JSON representation

Tips to start working with R

Awesome Lists containing this project

README

        

---
output: github_document
---

# rstartup

[![License](https://img.shields.io/github/license/mcanouil/rstartup)](LICENSE)

This is the repository for the slides about how to have a good start with R (in French).

```{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()
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)
}
```

```{r, results = "asis", echo = FALSE}
glue::glue('Title Slide')
```