Skip to content

Instantly share code, notes, and snippets.

View kevinsoo's full-sized avatar

Kevin Soo kevinsoo

View GitHub Profile
@kevinsoo
kevinsoo / TidyTuesday_20180821_CaliforniaWildfires.R
Last active August 21, 2018 20:25
Visualization of California wildfire data
#### R4DS TidyTuesday 2018-08-21
#### Exploring California widfires
#### https://github.com/rfordatascience/tidytuesday/tree/master/data/2018-08-21
#### By Kevin Soo
# Load libraries
library(tidyverse)
library(gganimate)
library(scales)
@kevinsoo
kevinsoo / RandomWalk_FantasyDraft.R
Last active August 19, 2018 01:47
Script to randomize and visualize draft order for Fantasy Football League
#### Load stuff
library(tidyverse)
library(gganimate)
#### Generate data
n <- 20 # Number of iterations/steps
# Random walk for 4 players, add players as needed
df <- tibble(
ite = 0:n,
@kevinsoo
kevinsoo / DataTarik_ketupat.R
Last active June 16, 2018 02:17
This code plots a ketupat on a graph for Hari Raya consumption.
#### Code for making ketupat
#### By Kevin Soo
library(tidyverse)
data <- tibble(
x = c(2, 3, 3, 4, 4, 4, 5, 5, 6) + 1,
y = c(3, 4, 2, 5, 3, 1, 4, 2, 3) + 2,
z = as.factor(c(1, 2, 2, 1, 1, 1, 2, 2, 1))
)
@kevinsoo
kevinsoo / WeddingSeating.R
Created June 30, 2017 11:51
WeddingSeating
#### This script takes a data frame of guest characteristics and assigns them to tables based on similarity
# The 'GuestData.csv' should have the following columns: 'LastName', 'FirstName', 'Attribute1', 'Attribute2', etc.
# Each attribute should be a vector of 1's and 0's
# load packages
library(tidyverse)
library(reshape2)
library(lsa)
library(devtools)
library(igraph)
@kevinsoo
kevinsoo / gwctdEmails.R
Last active March 21, 2017 13:21
Automate emails from a spreadsheet for GWCTD
#######################################################################################
#### Script to send emails out to hosts and guests for Guess Who's Coming to Dinner,
#### City Reformed Presbyterian Church's annual event pairing people with random/secret
#### dinner partners. This script takes information about participants and emails them.
#### Author: Kevin Soo
#######################################################################################
# load libraries
library(tidyverse)
library(gmailr)
@kevinsoo
kevinsoo / ValentinesDay2017.R
Last active February 14, 2017 16:37
Code to create a Valentine's day greeting (2017)
# This code generates a scatterplot with a greeting
# Maybe next year I'll get my wife a real card + flowers
# load libraries
library(tidyverse)
library(gganimate)
library(ggthemes)
# data (greeting can be changed here)
text <- c("Happy", "Valentine's", "Day", "to", "my", "statistically", "significant", "other!", "Though", "the", "holiday", "is", "arbitrary,", "every", "extra", "day", "with", "you", "means", "the", "world", "to", "me!")
@kevinsoo
kevinsoo / SaveTheDate.R
Last active December 14, 2015 16:04
Code used to create Kevin & Evelyn's Save The Date! Inspired by xkcd.
##### This code was used to create an xkcd-themed graph used for our Save The Date
# Import libraries
library("ggplot2")
library("xkcd")
# Create data for plotting
Evelyn <- sin(1/(1:40)^1.5)
Kevin <- -sin(1/(1:40)^1.5)
t <- c(1:40)