Skip to content

Instantly share code, notes, and snippets.

#' 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 / 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}/" %>%
@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 / README.md
Created May 7, 2019 01:13
adam-garcia.net

Data files for adam-garcia.net analyses

/* 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);
zoo
data.table
dplyr
tidyr
@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(
@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.