Skip to content

Instantly share code, notes, and snippets.

View zross's full-sized avatar

Zev Ross zross

View GitHub Profile
@zross
zross / index.html
Created November 18, 2014 17:32
Slidify blog post 1
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>R crash course</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="http://slidifylibraries2.googlecode.com/git/inst/libraries/frameworks/revealjs/css/reveal.min.css">
@zross
zross / index.html
Last active August 29, 2015 14:09
Slidify blog post 2
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>R crash course</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
@zross
zross / index.html
Created November 18, 2014 18:50
Slidify blog post 3
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>R crash course</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
@zross
zross / index.html
Created November 18, 2014 19:07
Slidify blog post 0
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>R crash course</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
@zross
zross / ggplot_map.R
Last active August 29, 2015 14:10
ggplot2 map using borders()
# In response to a question on our ggplot2/mapping post
# (http://zevross.com/blog/2014/07/16/mapping-in-r-using-the-ggplot2-package/)
# this is an example of using ggplot2's built-in
# borders() function and an external shapefile
# The shapefile used in that blog post is a projected shapefile
# but by default the borders() function uses unprojected
# boundaries so you will need to "unproject" the shapefile
# for the borders to match. An alternative would be to assign
# a projection with map() arguments
@zross
zross / ribbon
Created January 22, 2015 16:20
Create shooting ribbon plot
# quick example of creating a plot like that at the link below
# http://www.visualisingdata.com/index.php/2015/01/make-grey-best-friend/
x<-1:10
y<-x^2
z<-x
radius<-x/5
dat<-data.frame(x=x, y=y, z=z, radius=radius)
ggplot(dat, aes(x,y))+
geom_ribbon(aes(ymin=y-radius, ymax=y+radius), alpha=0.5, fill="grey", color="grey", size=1)+
@zross
zross / index.html
Last active August 29, 2015 14:14
Morph Montana into Idaho with D3
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: #ccc;
stroke: #000;
}
</style>
@zross
zross / format_dates.md
Last active August 29, 2015 14:22
Formatting dates in R reference

R date formatting

#strptime() to convert from character to date/time
#format() to reformat the date

format(strptime("2001-05-05", "%Y-%m-%d"), "%A %B%e, %Y")
#"Saturday May 5, 2001"

format(strptime("2001-05-05 01:05 PM", "%Y-%m-%d %I:%M %p"), "%d/%m/%Y %H:%M")
@zross
zross / east_town_mall.geojson
Created October 30, 2015 19:50
East Towne Mall
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zross
zross / HTML: boilerplate
Created April 4, 2013 13:23
HTML: boilerplate w jquery
<!DOCTYPE html>
<html>
<head>
<title>HTML5</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=650, user-scalable=yes">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>