Blog Archives

A “did you mean?” Feature for R

December 10, 2014
By

Most search engines have a "did you mean?" feature, where suggestions are given in the presence of likely typos. And while search engines use sophisticated NLP methods on their vast amounts of user-generated data to create accurate suggestions, you can get by with some ancient spellchecker techniques. So a little while ago, I did just that with the Rdym...

Read more »

Introducing Rfiglet: ASCII logos from the comfort of R

August 19, 2014
By

The Rfiglet Package For those who don't know what figlet is, it's a command line utility for creating ascii logos.  Rfiglet, therefore, is a set of R bindings for figlet. Works about like you would expect: There are over 150 fonts available, and you can see an example of each one in this Rfiglet package vignette. We can even...

Read more »

A New Use for Pipes in R: Forkbombs

August 6, 2014
By

Almost 3 years ago, I wrote about how to forkbomb with R. A quick recap is that a forkbomb is a low-tier, malicious misuse of a system; sort of a "baby's first denial of service". The idea is that you write a program that will start an entirely new copy of itself each time it is executed. Executing it...

Read more »

“F-bombs” in GitHub Commits (warning: contains profanity)

July 30, 2014
By
“F-bombs” in GitHub Commits (warning: contains profanity)

Warning: this post contains profanity...arguably excessive amounts of it.  If you are a humorless no-fun, you are recommended to proceed no further. Seriously though, the title is quite descriptive of the content of this post.  If you are offended by the use of such language, or if your boss is likely to come peering over your shoulder soon, I...

Read more »

Advanced R Profiling with pbdPAPI

July 22, 2014
By
Advanced R Profiling with pbdPAPI

R has some extremely useful utilities for profiling, such as system.time(), Rprof(), the often overlooked tracemem(), and the rbenchmark package. But if you want more than just simple timings of code execution, you will mostly have to look elsewhere. One of the best sources for profiling data is hardware performance counters, available in most modern hardware. This data can...

Read more »

Modern Applied Statistics in R’lyeh

June 30, 2014
By
Modern Applied Statistics in R’lyeh

So you've probably heard of King James Programming; if not, you should check it out because it's great. A quick summary is that someone took the King James Bible and Sussman's Structure and Interpretation of Computer Programs (SICP) and used an n-gram babbler to generate new sentences that combine the texts in amusing ways. The generator itself is a...

Read more »

Searching an R Function’s Source Code

May 1, 2014
By

This is not nearly as interesting as it might first sound, but every function in R contains R code; this is true of core R code as well as extension packages. Sometimes the R code is just a very shallow wrapper around some compiled code, such as in sum() and is.null(). Other times, as in lm.fit(), there is a...

Read more »

How to Make a Bad Password with R

February 24, 2014
By
How to Make a Bad Password with R

I have a lot of projects that will take ages to finish (some are in such poor shape that I tuck them away in private repositories, so no one can see my shame).  So sometimes it's nice to just take a weekend and crank out something start to finish, even if it's dumb and no one cares about it...

Read more »

Rules for Naming Objects in R

December 16, 2013
By

Naming Rules in R How are objects allowed to be named in R? As it turns out, this is a very different question from how should objects be named. This isn't about style conventions, camelCase, dots.verus_underscores, or anything like that; this is about what is strictly possible. I do a lot of outreach to HPC people who are starting...

Read more »

Intentionally Writing Obtuse Code

December 9, 2013
By

Sometimes intentionally writing bad code can be a lot of fun. Now here, when I say "bad", I mean something that's functional but completely incoherent to anything but the machine. There are even competitions for this kind of thing, but I only consider myself a dabbler in this dark art. Thankfully, it's often pretty easy to make obtuse code...

Read more »