Skip to content

Instantly share code, notes, and snippets.

View zross's full-sized avatar

Zev Ross zross

View GitHub Profile
[{
"id": 1,
"sex_code": 1,
"mortality_death_age": [{
"mortality_death_age_id": 1,
"death_age": "death_age_00",
"death_num": "995"
}, {
"mortality_death_age_id": 2,
"death_age": "death_age_01",
[
{
"name": "Germany",
"series": [
{
"name": "2010",
"value": 7300000
},
{
"name": "2011",
[{
"name": "death_age_95",
"series": [{
"name": "Females",
"value": -6517
}, {
"name": "Males",
"value": 1891
}]
}, {
[{
"results": [{
"name": "death_age_95",
"series": [{
"name": "Females",
"value": 6517
}, {
"name": "Males",
"value": 1891
}]
@zross
zross / scrape_spatial.R
Created April 30, 2019 13:03
For getting download counts for spatial packages
# Grab the list of spatial packages from the R Task View (Bivand)
# and get the count of monthly downloads
library(rvest)
library(dplyr)
spatial_task_view <- read_html("https://cran.r-project.org/web/views/Spatial.html")
res <- spatial_task_view %>%
html_nodes(xpath = "/html/body/ul[1]") %>%
html_children() %>%
@zross
zross / spatial_example.R
Last active March 19, 2018 14:54
Spatial analysis with R
# An example of spatial analysis with R that involves grabbing data
# from a PostGIS database, joining to tabular data, projecting
# simplifying and creating an interactive map.
# This data is publicly available but requires some processing
# if you want the county boundaries you can find them here:
# cftp://ftp2.census.gov/geo/tiger/TIGER2016/COUNTY/
# The tabular data requires some processing but the raw data
@zross
zross / nested_for_loops.R
Created December 15, 2017 21:31
Testing nested for loops with foreach
# The idea I'm trying to test is if I can nest a parallel
# for loop inside another parallel for loop.
# The following does open up 4 cores with the first loop
# and opens an additional 3 cores with the second. I see
# seven running at one time, the four are turned off then
# 3 are turned off.
# I'm not sure if this is truly 7 parallel cores or if it's
# 4 then 3 sequentially.
@zross
zross / non-gis-y-webmapping.md
Last active February 8, 2019 18:01
Web mapping applications with multiple layers

Suggestions from Twitter for more "elegant" web mapping applications

Specifically I'm looking for web mapping applications that include multiple layers and don't look like an ArcGIS clone -- perhaps something that looks like it was designed by a designer rather than a GIS tech :) This is a list of responses from Twitter, many of which do look GIS-y so more suggestions are welcome...

@zross
zross / markdown_style.css
Created September 21, 2017 16:58
markdown_style.css
body{
color:red;
}