This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pkgs | |
| pacman::p_load(tidyverse, polite, scales, ggimage, ggforce, | |
| rvest, glue, extrafont, ggrepel, magick) | |
| loadfonts() | |
| ## add_logo function from Thomas Mock | |
| add_logo <- function(plot_path, logo_path, logo_position, logo_scale = 10){ | |
| # Requires magick R Package https://github.com/ropensci/magick |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| library(DT) | |
| data <- read.csv('https://colorado.rstudio.com/rsc/content/2352/data.csv') | |
| ui <- fluidPage( | |
| titlePanel("Basic Data Filter Application"), | |
| hr(), | |
| h4("This application presents data generated by a scheduled R Markdown process: ", tags$a(href="https://colorado.rstudio.com/rsc/content/2352", "See it here!")), | |
| p("Use this framework to build out your own R Markdown-based ETL jobs hosted on RStudio Connect."), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| library(dplyr) | |
| library(tibble) | |
| library(tidyr) | |
| GeomVector <- ggproto("GeomVector", Geom, | |
| required_aes = c("x", "y", "direction", "length"), | |
| default_aes = aes( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install.packages(c("here", "fs", "stringr", "purrr", "git2r")) | |
| # to add invisibly in your R profile, open with usethis::edit_r_profile() | |
| # then define it in an environment, e.g. | |
| # .env <- new.env() | |
| # .env$move_slides_to_web <- {function definition} | |
| move_slides_to_web <- function(folder = NULL, index = NULL) { | |
| if (is.null(folder)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # devtools::install_github("yixuan/fontr") | |
| library(fontr) | |
| library(transformr) | |
| library(showtext) | |
| library(tidyverse) | |
| library(gganimate) | |
| # use showtext to loading Google fonts (http://www.google.com/fonts) | |
| font_add_google("Allura") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add this to your .Rprofile | |
| options( | |
| error = quote(rlang::entrace()), | |
| rlang__backtrace_on_error = "collapse" # or "branch" or "full" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <RTestCase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:noNamespaceSchemaLocation="../xsd/RTest.xsd"> | |
| <ID>RTest_TC-medium</ID> | |
| <synopsis> | |
| <version>01</version> | |
| <author>Sebastian Wolf</author> | |
| <creation-date>2018-12-11</creation-date> | |
| </synopsis> | |
| <input-data> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(magick) | |
| steps <- 10000L | |
| coil_turns <- 3L | |
| max_r <- coil_turns * 2 * pi | |
| imgs <- image_graph(300, 300, res = 30) | |
| rotation <- pi/4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A proposal for a Chrome Remote Interface with R | |
| # Copyright: Romain Lesur | |
| # Year: 2018 | |
| # License: MIT | |
| # Browser and websocket connection helpers -------------------------------- | |
| # From milesmcbain/chradle (MIT License) | |
| debugger_200_ok <- function(port, retry_delay = 0.2, max_attempts = 15, attempt = 1) { | |
| if (max_attempts <= attempt) { | |
| stop(paste0("Reached max attempts (", max_attempts, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Packages --------------------------------------------------------------- | |
| remotes::install_github('milesmcbain/chradle') | |
| remotes::install_github('rlesur/pagedown@automation') | |
| library(chradle) | |
| library(pagedown) | |
| library(httpuv) | |
| # Chrome headless helpers ------------------------------------------------- | |
| # Thanks to Miles McBain | |
| browser_init <- function(debug_port = 9222, bin = "google-chrome"){ |