Skip to content

Instantly share code, notes, and snippets.

package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.BlendMode
import org.openrndr.draw.DrawPrimitive
import org.openrndr.draw.VertexElementType
import org.openrndr.draw.renderTarget
import org.openrndr.draw.shadeStyle
import org.openrndr.draw.vertexBuffer
@ganzuul
ganzuul / linkshere.r
Last active November 10, 2019 19:53
en.wikipedia.org/wiki/Special:WhatLinksHere to R via REST API
#install.packages("httr") #install.packages("jsonlite") #install.packages("tidyverse")
#install.packages("stringr") #install.packages("furrr") #install.packages("igraph")
require(httr)
require(jsonlite)
require(tidyverse)
require(stringr)
#require(furrr) #require(igraph)
url_base <- "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=linkshere&lhlimit=500"
articles <- c("Maximal and minimal elements", "Maxima and minima")
# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat
# Originally seen at http://spatial.ly/2014/08/population-lines/
# So, this blew up on both Reddit and Twitter. Two bugs fixed (southern Spain was a mess,
# and some countries where missing -- measure twice, submit once, damnit), and two silly superflous lines removed after
# @hadleywickham pointed that out. Also, switched from geom_segment to geom_line.
# The result of the code below can be seen at http://imgur.com/ob8c8ph
library(tidyverse)