Monthly Archives: May 2006

Here’s an improved system.time function for R

May 14, 2006
By

R’s current system.time function doesn’t name the vector of return values. Doing so makes it easier to understand the output. IMO, the current code has two uglies: it sets an on.exit hook and then calls on.exit() explicitly. It also computes the elapsed time twice (once for the stdout message and once for the

Read more »

Here’s an improved system.time function for R

May 14, 2006
By

R’s current system.time function doesn’t name the vector of return values. Doing so makes it easier to understand the output. IMO, the current code has two uglies: it sets an on.exit hook and then calls on.exit() explicitly. It also computes the ...

Read more »

Aggregating Results from Unreliable Functions in R

May 12, 2006
By

I posted this as a response to a question on R-help. I think the idea of a “collect” function could be useful both in the context of unreliable functions that sometimes error out and also in filtering contexts where currently one creates a list containing good elements and some sort of sentinel, usually NULL,

Read more »

Aggregating Results from Unreliable Functions in R

May 12, 2006
By

I posted this as a response to a question on R-help. I think the idea of a “collect” function could be useful both in the context of unreliable functions that sometimes error out and also in filtering contexts where currently one creates a list co...

Read more »

Merging data: A tutorial

May 7, 2006
By
Merging data: A tutorial

The situation: you have two datasets with a common variable, and you want to incorporate both into one large dataset containing all of the variables. This is called merging data, and it’s easy to do in any standard statistical package. In these examples, I assume that there is only one variable between any datasets to

Read more »