Skip to content

Instantly share code, notes, and snippets.

# setwd("~/Downloads")
readKMZ <- function(f = NULL) {
zip <- paste0(f, ".zip")
file.rename(f, zip)
unzip(zip)
geojsonio::geojson_read("doc.kml", what = "sp")
}
pts <- readKMZ("MWAHIST12282016.kmz")
@brainprint
brainprint / softmax.R
Created November 17, 2016 20:46 — forked from aufrank/softmax.R
## from http://tr.im/hH5A
logsumexp <- function (x) {
y = max(x)
y + log(sum(exp(x - y)))
}
softmax <- function (x) {
exp(x - logsumexp(x))
}