Skip to content

Instantly share code, notes, and snippets.

@fototo
fototo / zellig.r
Created January 7, 2016 02:00 — forked from hrbrmstr/zellig.r
Single-source file for http://bit.ly/zellingenach
#' The single-file, 'source'-able version of https://github.com/hrbrmstr/zellingenach
#' More info here: http://bit.ly/zellingenach
#' By @hrbrmstr (2016)
#' MIT LICENSE
# NOTE THAT YOU NEED INTERNET ACCESS TO RUN THIS SCRIPT
# it pulls the three necessary files (only once) from my web site
library(V8)
library(dplyr)
@fototo
fototo / ExampleExamCode.R
Created January 18, 2016 06:25 — forked from vasishth/ExampleExamCode.R
Example code for automatically generating R exercises and exams
## Load library:
library("exams")
## exam questions:
myexamlist<-list("pnorm1","sesamplesize1multiplechoice")
## output directory
## create new test dir if one does not exist:
files.list<-system("ls",intern=TRUE)
###############################################
# working with complete set of 2015 play-by-play data
# collected using the getData function in the openWAR
# package (retrieves MLBAM GameDay files)
# currently have this saved as a Rdata file
###############################################
load("alldata2015.Rdata")
# computes the run values of all plate appearances
## source: https://github.com/toddwschneider/nyc-taxi-data/blob/master/analysis/analysis.R
dropoffs = query("SELECT * FROM dropoff_by_lat_long_cab_type ORDER BY count")
dropoffs = mutate(dropoffs, cab_type_id = factor(cab_type_id))
p = ggplot() +
geom_polygon(data = ex_staten_island_map,
aes(x = long, y = lat, group = group),
fill = "#080808", color = "#080808") +
geom_point(data = dropoffs,
aes(x = dropoff_long, y = dropoff_lat, alpha = count, size = count, color = cab_type_id)) +
@fototo
fototo / Segmentation.ipynb
Created March 17, 2016 14:59 — forked from stuartlynn/Segmentation.ipynb
Segmentation Generation from Census and PUMAS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
library(idbr)
library(ggplot2)
library(animation)
library(dplyr)
library(gganimate)
idb_api_key("Your Census API key goes here")
male <- idb1('IN', 2000:2050, sex = 'male') %>%
mutate(POP = POP * -1,
@fototo
fototo / read_vs_skim.js
Created May 17, 2016 00:30 — forked from akngs/read_vs_skim.js
GA custom event trigger which tracks reading behavior
<script>
try {
document.addEventListener("DOMContentLoaded", function() {
var accumScrollMove = 0;
// Set it 1 msecs to avoid div by zero error
var accumScrollTime = 1;
var latestScrollTop = 0;
var latestScrollAt = new Date();
function checkScroll() {
@fototo
fototo / README.md
Created December 2, 2016 02:14 — forked from e9t/README.md
식신로드 만점 식단 20선
#load the package
require(h2o)
#start h2o
localH2o <- h2o.init(nthreads = -1, max_mem_size = "20G")
#load data on H2o
trainh2o <- as.h2o(train)
testh2o <- as.h2o(test)
@fototo
fototo / geoplot_viridis.ipynb
Created March 23, 2017 16:33 — forked from darribas/geoplot_viridis.ipynb
`geoplot` Viridis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.