Skip to content

Instantly share code, notes, and snippets.

Dave Armstrong davidaarmstrong

Block or report user

Report or block davidaarmstrong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidaarmstrong
davidaarmstrong / can_census_fed.r
Created Nov 13, 2019
This code maps Canada Census Subdivisions from the 2016 Census onto Federal Electoral Districts from the 2013 representation order.
View can_census_fed.r
library(dplyr)
library(sf)
library(rgeos)
library(rgdal)
## Download: https://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/bound-limit-2016-eng.cfm
## choose ArcGIS (.shp) and Federal Electoral Districts (2013 Representation Order)
## read in electoral district boundaries.
eb <- read_sf("FED_CA_2_2_ENG.shp")
@davidaarmstrong
davidaarmstrong / gamlss_ma.r
Created Sep 11, 2019
Multivariate Adaptive Regression Splines smoother for GAMLSS models
View gamlss_ma.r
ma <- function (formula, method = c("earth"), control = list(NULL),
...) {
method <- match.arg(method)
scall <- deparse(sys.call(), width.cutoff = 200L)
if (!is(formula, "formula"))
stop("formula argument in ma() needs a formula starting with ~")
rexpr <- grepl("gamlss", sys.calls())
for (i in length(rexpr):1) {
position <- i
if (rexpr[i] == TRUE)
You can’t perform that action at this time.