This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% I use the memoir class for everything. `texdoc memoir` from your command | |
% prompt (on Mac & Linux anyway) has all the details. It's better. | |
\documentclass[11pt,letterpaper,article]{memoir} % for a short document | |
\usepackage{lipsum} | |
\usepackage{amsmath} | |
\usepackage{latexsym} | |
% Useful for Knitr. Otherwise, I use memoir class's 'ctabular' env. | |
\usepackage{longtable} | |
\newsubfloat{figure}% Allow subfloats in figure environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Statewide obesity data | |
# from http://massey.limfinity.com/data/ | |
library(gdata) | |
library(ggplot2) | |
# stringsAsFactors=FALSE is important more often than not. | |
obesity <- read.xls("http://massey.limfinity.com/data/obesity.xls", | |
sheet=1, stringsAsFactors=FALSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
# ESRI FileGDB support. This recipe can download the file from ESRI, | |
# however, you must sign into the ESRI support site and agree to their | |
# licensing terms from a webbrowser. | |
class Filegdb < Formula | |
homepage 'http://www.esri.com/software/arcgis/geodatabase/interoperability' | |
url 'http://downloads2.esri.com/Software/FileGDB_API_1_3-64.zip' | |
sha1 '95ba7e3da555508c8be10b8dbb6ad88a71b03f49' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages(c("rgdal", "rgeos", "ggmap", "maptools")) | |
library(rgdal) | |
library(rgeos) | |
library(ggmap) | |
library(maptools) | |
# Read the shapefile with OGR. Punctuation matters: No trailing slash | |
# on the dsn, and no .shp on the layer | |
udist <- readOGR(dsn="/Users/peter/Downloads/clip", | |
layer="unidstuc") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You may need to install a couple libraries before loading them: | |
# install.packages(c("ggmap", "plyr", "rgdal")) | |
library(ggmap) | |
library(plyr) | |
library(rgdal) | |
# Here we read in a shapefile containing the centroids of our TAZs | |
zonecentroids <- readOGR(dsn="/path/containing/shapefile/no/final/slash", | |
layer="shapefile-containing-points") |
NewerOlder