Skip to content

Instantly share code, notes, and snippets.

View patperry's full-sized avatar

Patrick O. Perry patperry

View GitHub Profile
@patperry
patperry / cranlogs-wtf
Last active September 20, 2017 22:06
Strange CRAN download behavior
# I released version 0.9.0 of corpus on 2017-08-19
# (http://corpustext.com/ )
# Here are the download logs from the day after
tmp <- tempfile(fileext = ".csv.gz")
download.file("http://cran-logs.rstudio.com/2017/2017-08-20.csv.gz", tmp)
data <- read.csv(tmp, stringsAsFactors = FALSE)
# I'm going to look at "corpus" downloads from Great Britain
corpus_gb <- subset(data, package == "corpus" & country == "GB")
@patperry
patperry / arima-bug
Created April 19, 2015 17:44
Bug in arima (sigma2 calculation)
# There is currently a bug in the arima function. The innovation variance
# estimate uses the wrong denominator whenever xreg is non-null. This bug was
# introduced in the patch displayed here:
#
# https://github.com/wch/r-source/commit/32f633885a903bc422537dc426644f743cc645e0
#
# The fix is very simple:
#
# https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16278#c4 (comment 4).