This has really challenged my ability to debug R code.
I want to use ddply() to apply the same functions to different columns that are sequentially nam
ddply()
Today's solution to this question is to make summarize into here(summarize). e.g.
summarize
here(summarize)
myFunction <- function(x, y){ NewColName = "a" z = ddply(x, y, here(summarize), Ave = mean(eval(parse(text=NewColName)), na.rm=TRUE) ) return(z) }
here(f), added to plyr in Dec 2012, captures the current context.
here(f)