Skip to content

Instantly share code, notes, and snippets.

View abnova's full-sized avatar

Aleksandr Blekh abnova

View GitHub Profile
@abnova
abnova / rUpdateFlex.R
Created September 16, 2014 05:46
Script for flexible updating R from both CRAN (primary) and R-Forge
# Answer by Sharpie to the following SO question:
# http://stackoverflow.com/q/3971815/2872891
# 1. Get the list of packages you have installed,
# use priority to exclude base and recommended packages.
# that may have been distributed with R.
pkgList <- installed.packages(priority='NA')[,'Package']
# 2. Find out which packages are on CRAN and R-Forge. Because
# of R-Forge build capacity is currently limiting the number of
@abnova
abnova / nrowDir.R
Last active August 29, 2015 14:06
Print number of rows in each R data object file in a current directory
lapply(seq_along(a), function(i) {print(paste0(a[i], ": ", nrow(readRDS(a[i]))))})
@abnova
abnova / tsHSales.txt
Created February 27, 2015 04:07
Text dump of 'hsales' data set from 'fma' R package (restore by assigning the contents to an arbitrary R object) -- Re: discussion at http://stats.stackexchange.com/a/139518/31372
structure(c(55, 60, 68, 63, 65, 61, 54, 52, 46, 42, 37, 30, 37,
44, 55, 53, 58, 50, 48, 45, 41, 34, 30, 24, 29, 34, 44, 54, 57,
51, 51, 53, 46, 46, 46, 39, 41, 53, 55, 62, 55, 56, 57, 59, 58,
55, 49, 47, 57, 68, 84, 81, 78, 74, 64, 74, 71, 63, 55, 51, 57,
63, 75, 85, 80, 77, 68, 72, 68, 70, 53, 50, 53, 58, 73, 72, 68,
63, 64, 68, 60, 54, 41, 35, 43, 44, 44, 36, 44, 50, 55, 61, 50,
46, 39, 33, 37, 40, 49, 44, 45, 38, 36, 34, 28, 29, 27, 29, 28,
29, 36, 32, 36, 34, 31, 36, 39, 40, 39, 33, 44, 46, 57, 59, 64,
59, 51, 50, 48, 51, 45, 48, 52, 58, 63, 61, 59, 58, 52, 48, 53,
55, 42, 38, 48, 55, 67, 60, 65, 65, 63, 61, 54, 52, 51, 47, 55,