https://github.com/brentthorne/posterdown
https://github.com/rstudio/pagedown
https://github.com/GerkeLab/betterposter
| library(stringr) | |
| library(purrr) | |
| vowels <- c("a", "e", "i", "o", "u") | |
| is_vowel <- function(l) l %in% c(vowels, toupper(vowels)) | |
| is_capitalized <- . %>% substr(1, 1) %>% str_detect("[[:upper:]]") | |
| split_at <- function(x, i) split(x, cumsum(seq_along(x) %in% i)) | |
| pigify_word <- function(word) { | |
| ltrs <- strsplit(word, "")[[1]] |
| #REF: https://cran.r-project.org/web/packages/wordcloud2/vignettes/wordcloud.html | |
| #INSPIRED BY: http://www.masalmon.eu/2017/02/28/rbloggerstweets/ | |
| #PACKAGES | |
| library(rtweet) | |
| library(dplyr) | |
| library(tidytext) | |
| library(rcorpora) | |
| library(wordcloud2) |
| library(rvest) | |
| library(tidyverse) | |
| library(ggbeeswarm) | |
| library(hrbrmisc) | |
| library(ggalt) | |
| library(gridExtra) | |
| sprintf("http://cran.rstudio.org/src/base/R-%d", 0:3) %>% | |
| map(read_html) %>% | |
| map(html_table) %>% |
| # To install curl with HTTP2 on MacOS: | |
| brew reinstall curl --with-nghttp2 | |
| brew link --force curl | |
| curl --version # must be 7.51.0 | |
| # Example that fails with HTTP2 | |
| curl -v https://api.monkeylearn.com/v2/classifiers/test/classify/ \ | |
| -d '{"text_list":["my dog is an avid rice eater","i want to buy an iphone"]}' | |
| # Error: |
| library(emoGG) | |
| library(ggplot2) | |
| #use subsetting to display different emojis for different factor levels | |
| ggplot(mtcars, aes(wt, mpg))+ | |
| geom_emoji(data = mtcars[mtcars$am==1, ], emoji = "1f697") + | |
| geom_emoji(data = mtcars[mtcars$am==0, ], emoji = "1f68c") |
| { | |
| repository(name: "sickvim", owner: "jonathansick") { | |
| ref(qualifiedName: "master") { | |
| target { | |
| ... on Commit { | |
| id | |
| history(first: 5) { | |
| pageInfo { | |
| hasNextPage | |
| } |
| # function to identify what changed where | |
| which_changed <- function(x, y = x) { | |
| # argument validation | |
| stopifnot(inherits(x, "data.frame")) | |
| stopifnot(inherits(y, "data.frame")) | |
| stopifnot(identical(dim(x), dim(y))) | |
| y <- y[, names(x)] | |
| # compare objects |
| We set up knitr so it doesn't catch errors, then set | |
| `options(error=recover)` to set up R's debug-on-error machinery. | |
| We have to do one additional thing, before the options call though: | |
| trace the recover function with`sink(NULL)` to turn off the output | |
| capturing so the R console is useful when the debugging framework | |
| dumps us back into it. This has to happen before the options call | |
| because that call grabs the `recover` object and stores it somewhere | |
| so setting a trace on recover after the call won't affect the cached | |
| version that gets called upon an error. |
| .First<-function(){ | |
| cat(paste0("My data has been breached ", | |
| length(HIBPwned::account_breaches("stephanie.g.locke@gmail.com")$name), | |
| " times (that we know of)")) | |
| } |