This choropleth encodes unemployment rates from 2008 with a quantize scale ranging from 0 to 15%. A threshold scale is a useful alternative for coloring arbitrary ranges.
This file contains hidden or 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
setwd("~/Downloads") | |
obs <- XML2Obs("out.xml", url.map=TRUE) | |
unique(names(obs)) #you might want to re_name or add_key before collapsing | |
tmp = add_key(obs, parent="url1//osm//way", key.name="way_id") | |
tmp = add_key(tmp, parent="url1//osm//node", key.name="node_id") | |
tmp = add_key(tmp, parent="url1//osm//relation", key.name="relation_id") | |
tables <- collapse(obs) # holy crap this takes a long-ass time | |
write.table(tables$`url1//osm//way//nd`, "ways.csv", sep=",") | |
write.table(tables$`url1//osm//way//tag`, "way_tags.csv", sep=",") | |
write.table(tables$`url1//osm//node`, "nodes.csv", sep=",") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You need to get to the bit representation of the float, and then:
inline unsigned int float2fint(unsigned int f) {
return f ^ ((-(f >> 31)) | 0x80000000);
}
Callahan et al. used this trick in this paper.
Caveats:
This file contains hidden or 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 should totally ignore this because it's the first piece of Julia I've ever written. | |
# 2-clause BSD, blah. | |
function make_cycle(n) | |
result = Dict{Int32, Array{Int32}}() | |
for i = 1:n | |
ii = i - 1 | |
push!(result, i, [1 + ((i+n-2) % n), 1 + i % n]) | |
end | |
result |
A demo of TopoJSON on a U.S. counties shapefile from the census bureau using d3.geo.albersUsa. The same TopoJSON file can also be used to show counties.
The scatterplot matrix visualizations pairwise correlations for multi-dimensional data; each cell in the matrix is a scatterplot. This example uses Anderson's data of iris flowers on the Gaspé Peninsula. Scatterplot matrix design invented by J. A. Hartigan; see also R and GGobi. Data on Iris flowers collected by Edgar Anderson and published by Ronald Fisher.
See also this version with brushing.
This file contains hidden or 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
import math | |
from pylab import * | |
def fact(x): | |
return math.gamma(x+1) | |
def choose(n,k): | |
return fact(n) / (fact(k) * fact(n-k)) | |
def hypergeom_mass_at_k(N, K, n, k): |
This file contains hidden or 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
license: gpl-3.0 |
I hereby claim:
- I am cscheid on github.
- I am cscheid (https://keybase.io/cscheid) on keybase.
- I have a public key ASCbHGh8DWbPaMRsAqX3jKu2t6uySLoIHP3RpjNWw7XvNQo
To claim this, I am signing this object: