Articles by R Tips

Self Aware Classes

February 11, 2010 | R Tips

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 ... [Read more...]

With With

January 31, 2010 | R Tips

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!

October 5, 2009 | R Tips

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 | R Tips

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 | R Tips

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...]

Saving a Workspace

November 11, 2008 | R Tips

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 | R Tips

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 more...]

pmin and pmax

September 16, 2008 | R Tips

Did you know that there are multiple versions of the min and max function. make sure that you are using the right one. pmin and pmax are the 'parallel' versions of the min and max function, meaning that they can take vector arguments and return vectors back. Much better than ... [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)