Aurelia Moser, Map Scientist, CartoDB Workshop - NICAR Session Link
March 6, 2015, 3:20PM-4:20PM
Find this document here:
- Stackedit:
-- Convert your states (or other geometries id'd by state) to | |
-- display as with Alaska, Hawaii, and Puerto Rico transcaled | |
-- | |
-- @param g: input geometry | |
-- @param state: column identifying the state (name, postal abbreviation, state FP) | |
-- | |
-- output: geometries of states in albers projections of the states | |
-- | |
-- Projections: |
#devtools::install("jeroenooms/V8") | |
library("V8") | |
library(pipeR) | |
ct = new_context("window") | |
# min.js gives me a call stack size error but non-min works fine | |
ct$source( | |
"https://raw.githubusercontent.com/morganherlocker/turf/master/turf.js" | |
) | |
# one of the examples from turf API docs |
#combine elements with same name in two named lists (useful for combining layouts) | |
appendList <- function (x, val) | |
{ | |
stopifnot(is.list(x), is.list(val)) | |
xnames <- names(x) | |
for (v in names(val)) { | |
x[[v]] <- if (v %in% xnames && is.list(x[[v]]) && is.list(val[[v]])) | |
appendList(x[[v]], val[[v]]) | |
else c(x[[v]], val[[v]]) | |
} |
# autoloess.R: compute loess metaparameters automatically | |
# Kyle Gorman <[email protected]> | |
aicc.loess <- function(fit) { | |
# compute AIC_C for a LOESS fit, from: | |
# | |
# Hurvich, C.M., Simonoff, J.S., and Tsai, C. L. 1998. Smoothing | |
# parameter selection in nonparametric regression using an improved | |
# Akaike Information Criterion. Journal of the Royal Statistical | |
# Society B 60: 271–293. |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
html, body, #map { | |
height: 100%; | |
padding: 0; | |
margin: 0; | |
} | |
</style> |