Archives by date

You are browsing the site archives by date.

Using Complex Numbers in R

Using Complex Numbers in R

This post is a continuation of my series dealing with matrix operations for image processing. My next goal is to demonstrate the construction of simple low-pass and high-pass spatial frequency filters in R. It’s easy enough to construct simple versions of these filters in R using the Fast Fourier Transform (also known as the FFT), […]

The Continuing Inanity of Hate Speech Laws

I’ve said it before: hate speech laws, whenever they exist, will always be exploited to suppress speech that’s politically charged. Italy’s proving my point this week, as it contemplates Web restrictions after the attack on Berlusconi.

Image Compression with the SVD in R

Update (2/26/2011): Thanks to Dan, I discovered that the first use of i in the code below was unclear. This is now fixed. Over the next few posts, I’m going to be reviewing the use of R to implement the most commonly used matrix techniques for image manipulation. The code will be surprisingly simple to […]

Quick Review of Matrix Algebra in R

Lately, I’ve been running a series of fMRI experiments on visual perception. In the interests of understanding the underlying properties of the images I’m using as stimuli, I’ve been trying to learn more about the matrix transformations commonly used for image compression and image manipulation. Thankfully, R provides simple-to-use implementations for all of the matrix […]

Some Pitfalls of Object Oriented Programming in R

Yesterday, I wrote a post about implementing setter methods for objects in R. On my way to understanding how to implement these methods correctly, I made a bunch of mistakes. To keep people from wasting their time with these same mistakes, I’m reviewing them here. Mistake One: Naming Conventions Every generic method will search for […]

Object-Oriented Programming in R: The Setter Methods

With a little guidance from the indefatigable Hadley Wickham, I figured out today how to implement the setter methods that were missing from my example user class. To review, let’s rebuild the getter methods for my user object: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 […]

The Most Basic Elements of Object-Oriented Programming in R

Until recently, I’ve never had any reason to learn how to define my own classes in R. Having learned this week, I was surprised to find out how easy it is to start implementing classes in R. If you know nothing about creating classes and class methods in R, here’s a very quick overview of […]

A Lot of Deaths are Partly Self-Induced

I’m a little surprised by Andrew Gelman’s post today, doubting the wisdom of a passage from Gary Becker’s work that reads: According to the economic approach, therefore, most (if not all!) deaths are to some extent “suicides” in the sense that they could have been postponed if more resources had been invested in prolonging life. […]

Times Series Methods versus Recurrence Relations

This term, I’ve been sitting in on Rene Carmona’s course on Modern Regression and Time Series Analysis. Much of the material on regression covered in the course was familiar to me already, but I’ve never felt that I had a real command of times series analysis methods. When Carmona defined the AR(p) model in class […]

R Function Usage Frequencies, Addendum

Since people have asked, here is a GitHub page with all of the code used to generate my R function usage analyses: cran-function-usage-analysis.