Skip to content

Instantly share code, notes, and snippets.

👨‍💻
just typing R code...

Garrick Aden-Buie gadenbuie

👨‍💻
just typing R code...
Block or report user

Report or block gadenbuie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View shiny_modules_reactlog_not_independent
options(shiny.reactlog = TRUE)
library(shiny)
library(reactlog)
mod_iris_ui <- function(id) {
ns <- NS(id)
tagList(
fluidRow(
column(
View new_tibble.md
library(tibble)

string1 <- sample(letters, 10000, replace = TRUE)
string2 <- sample(LETTERS, 10000, replace = TRUE)
listcol <- lapply(1:10000, function(x) sample(LETTERS, 5))

df_list <- list(s1 = string1, s2 = string2)
@gadenbuie
gadenbuie / ggplot2-linetype-example.md
Last active Jun 5, 2019
ggplot2 linetype example
View ggplot2-linetype-example.md
library(tidyverse)

tibble(y = 1:6, x = 0, xend = 1) %>%
  ggplot() +
  aes(x, y, xend = xend, yend = y, linetype = as.integer(y)) +
  geom_segment(size = 2) +
  theme_minimal(18) +
  scale_y_continuous(breaks = 1:6, trans = "reverse") +
  theme(
View enexpr_when.R
library(rlang)
enexpr_first <- function(x, aggr_func) {
browser()
func <- enexpr(aggr_func)
x <- aggr_func(x)
list(x = x, f = func)
}
enexpr_second <- function(x, aggr_func) {
View babynames-with-letters.md
View mueller-report_top-25-words.R
library(tidyverse)
library(tidytext)
mueller_report <- read_csv("mueller_report.csv")
mueller_report_tidy <-
mueller_report %>%
tidytext::unnest_tokens(word, text)
mueller_report_tidy %>%
View bootstrap_docker.sh
#!/bin/bash
# https://docs.docker.com/install/linux/docker-ce/debian/
# Get certificates
echo "Installing certificates..."
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
View tidyr_spread_example.md
library(tidyverse)

spread_var <- function(df, varname) {
  varname <- rlang::enquo(varname)
  spread(df, key = !!varname, count)
}

head(tidyr::table2)
#> # A tibble: 6 x 4
View git_outta_here.sh
#!/bin/bash
is_inside_git_repo() {
[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1
}
has_origin_remote() {
git remote get-url origin > /dev/null 2>&1
}
View everycolorbot_tweets.R
library(tidyverse)
library(rtweet)
tweets <- NULL
keep_going <- TRUE
i <- 1
while (keep_going && i <= 10) {
cat("\n", i, "...", sep = "")
tweets.this <- get_timeline(
"everycolorbot",
You can’t perform that action at this time.