Skip to content

Instantly share code, notes, and snippets.

@adam-garcia
adam-garcia / diy.Rmd
Last active April 30, 2020 02:51
r-d3
---
title: "Calendar - DIYD3"
output:
html_document:
df_print: paged
# template: heatmap_template.html
---
```{r echo = F, results = 'asis'}
knitr::opts_chunk$set(
zoo
data.table
dplyr
tidyr
/* rs-theme-name: Mojave Dark 2 */
/* rs-theme-is-dark: TRUE */
/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: D8D5E82E-3D5B-46B5-B38E-8C841C21347D) */
.ace_snippet-marker {
background: rgb(21,126,251);
color: white;
border: none !important;
border-top: 1px solid rgb(110, 111, 130);
border-bottom: 1px solid rgb(110, 111, 130);
@adam-garcia
adam-garcia / README.md
Created May 7, 2019 01:13
adam-garcia.net

Data files for adam-garcia.net analyses

@adam-garcia
adam-garcia / .gitignore
Created April 17, 2018 17:42
Gigignore for R Projects
# Forked from https://github.com/github/gitignore
# History files
.Rhistory
.Rapp.history
# R Project files
.Rproj.user
# Session Data files
.RData
@adam-garcia
adam-garcia / darksky.R
Last active April 13, 2018 18:38
DarkSky Time Machine API
library(tidyverse)
library(glue)
library(httr)
library(jsonlite)
library(lubridate)
library(purrr)
token <- NA
base <- "https://api.darksky.net/forecast/{token}/" %>%
#' santa(guests) is a function that assigns guests to a "secret santa" gift swap
#' @param guests the vector of partygoers
#' @return a tibble, with <guests> assigned in "to" and "from" columns
library(magrittr)
library(tibble)
santa <- function(guests) {
n <- length(guests)
tibble (
@adam-garcia
adam-garcia / README.md
Last active April 23, 2024 09:41
Viridis Color Palette Generator

Viridis Color Palette Generator

A simple tool for extracting discrete color palette values from the viridis collection of color palettes.

@adam-garcia
adam-garcia / extract_numeric.sas
Last active March 29, 2017 18:19
Helpful SAS Snippets
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
** *
** extract_numeric.sas *
** purpose: extract numeric component from string *
** todo: leading strings break pattern *
** *
`* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
data strings;
@adam-garcia
adam-garcia / hill
Last active November 9, 2016 18:26
HHHHHH >>HHHH
HHHHHH >>>>HH
HHHHHH