Blog Archives

Self Aware Classes

February 11, 2010
By

I thought this up the other night but I'm not sure where I'm going to use it. But I thought that I would through it out there anyway, maybe it will solve all of someone else's problems. I was thinking about classes in R and R is SO NOT object oriented...

Read more »

With With

January 31, 2010
By

No that is not a typo in the title. In my programming a came across a solution that I thought was pretty cool. I have a function that basically takes two objects and passes the elements of the objects to another function as arguments. This is a pret...

Read more »

Expressions in expresssion passed to functions that return functions

October 5, 2009
By

OK in the last two tips I explained how functions can return functions and how to leverage expressions. Now lets get complicated. This is really how my testing code works; expressions embeded in expressions that are passed to functions that return fu...

Read more »

Expressions!

October 5, 2009
By

I never really saw a use for these until I started testing code en mass. I found myself doing lots and lots of copy and paste. I heard it from Steve McConnell in his Code Complete book where he said if you are copying and pasting you are programming ...

Read more »

Functions from functions

October 5, 2009
By

I've been really busy lately working on my dissertation and applying for jobs. But I've found a few really cool things that I'd like to share. These are pretty complex things so lets break it up into a few tips. First Tip: did you know that you can re...

Read more »

More Recursion in R

May 26, 2009
By

I found another gem in R today. Earlier I commented about how R could do recursion, something that I love. I write some pretty complicated recursion functions in my research, but I also have a bad habit of compulsively reorganizing things. Now I've c...

Read more »

Getting at the internals of R functions

April 20, 2009
By

I got asked the question the other day about how to get to the internals of a function. I realized that this was not something that I had covered yet on my tips blog. read more

Read more »

Using partial name matching and match.arg

April 13, 2009
By

Sorry it has been so long to write an R tip. I've been really busy with my research, which you would think would produce lots of tips, but apparently not. Anyway here is a little tip to look at. read more

Read more »

Saving a Workspace

November 11, 2008
By

R will can save the users workspace at the end of a session so that he can take it up again where he left off. I personally don't like doing this but there are times when one would want to save their work, especially after complex and time consuming co...

Read more »

Working with directories

October 24, 2008
By

Something quite annoying to me is when I get an R script and I have to change all of the file references in the script. I get something like this this:source("C:\\Documents and Settings\\UserName\\Data\\...\\File1.R") data<-read.table("C:\\Documen...

Read more »