With With

January 31, 2010
By

(This article was first published on R Tips's blog, and kindly contributed to R-bloggers)

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 pretty simple thing to do but can be painful to type everything out

f<-function(obj1,obj2){
g(obj1$a,obj1$b,obj1$c,obj2$x,obj2$y,obj2%z)
}

read more

To leave a comment for the author, please follow the link and comment on his blog: R Tips's blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags:

Comments are closed.