Skip to content

Instantly share code, notes, and snippets.

View almartin82's full-sized avatar

Andrew Martin almartin82

View GitHub Profile
@almartin82
almartin82 / gist:2fe6a75ba5e19928e350
Last active August 29, 2015 14:16
profiling alternatives to lapply R if/else functions
#credits/inspiration to:
#http://alyssafrazee.com/vectorization.html
#http://www.johnmyleswhite.com/notebook/2013/12/22/the-relationship-between-vectorized-and-devectorized-code/
#http://r-de-jeu.blogspot.com/2013/01/search-and-replace-are-you-tired-of.html
time <- function (n, test_function, test_args) {
timings <- rep(NA, n)
for (itr in 1:n) {
start <- Sys.time()

Keybase proof

I hereby claim:

  • I am almartin82 on github.
  • I am almartin (https://keybase.io/almartin) on keybase.
  • I have a public key whose fingerprint is 1A92 BDE2 8900 6DF3 E30D 5D80 A130 A35E DF8A C6E2

To claim this, I am signing this object: