Skip to content

Instantly share code, notes, and snippets.

View mollietaylor's full-sized avatar

Shawn Mollie Taylor mollietaylor

View GitHub Profile
@mollietaylor
mollietaylor / cities-coords.csv
Last active January 4, 2016 03:59
Merge by City and State in R
City State Latitude Longitude
San Francisco CA 37.7782251 -122.4424955
New York NY 40.7142691 -74.0059729
Los Angeles CA 34.0522342 -118.2436849
Chicago IL 41.850033 -87.6500523
Dallas TX 32.7830556 -96.8066667
Columbus GA 32.4609764 -84.9877094
Columbus OH 39.9611755 -82.9987942
@mollietaylor
mollietaylor / index.html
Created January 22, 2014 18:44
Add and Remove Leaflet Circle on Click
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>Click Circle</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mollietaylor
mollietaylor / factorDummies.R
Created January 2, 2014 02:45
Compare Regression Results to a Specific Factor Level in R
str(ChickWeight$Diet)
table(ChickWeight$Diet)
ols <- lm(weight ~ Time + Diet,
data = ChickWeight)
summary(ols)
ChickWeight$Diet <- relevel(ChickWeight$Diet,
ref = 4)
@mollietaylor
mollietaylor / fit.R
Last active October 21, 2018 21:52
ggplot or Lattice Fit Line in R
ols <- lm(Temp ~ Solar.R,
data = airquality)
summary(ols)
str(ols)
plot(Temp ~ Solar.R,
data = airquality)
abline(ols)
@mollietaylor
mollietaylor / index.html
Created November 21, 2013 14:29
Import JSON Data from an External File in Leaflet
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>Cities I've Been To</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
@mollietaylor
mollietaylor / presentations.txt
Created November 16, 2013 22:29
Govathon presentations
bus tracker
trash collection 404-620-5025
budget app http://public.tableausoftware.com/views/Expenses_2_0/DepartmentDashboard#1
innovations app
APS parent portal
form flow
votified http://votified.com/
geoincentives wordpress plugin
vendor application
municiplanner http://municiplanner.org/
@mollietaylor
mollietaylor / quickStart.html
Last active December 26, 2015 06:49
Make All Polygons the Same Shade in Leaflet
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>Quick Start</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
@mollietaylor
mollietaylor / lineBreaks.R
Last active October 21, 2018 21:52
Line Breaks Between Words in Axis Labels in ggplot in R
library(OIdata)
data(birds)
library(ggplot2)
levels(birds$effect) <- gsub(" ", "\n", levels(birds$effect))
ggplot(birds,
aes(x = effect,
y = speed)) +
geom_boxplot() +
coord_flip()
@mollietaylor
mollietaylor / map-new-legend.R
Created September 29, 2013 23:02
Custom Legend in R
library(OIdata)
library(RColorBrewer)
library(classInt)
# load state data from OIdata package:
data(state)
# set constants:
nclr <- 8 # number of bins
min <- 0 # theoretical minimum