Hello, Gabor
Generally, I follow the r-help rules and provide working code snippets
to illustrate the problem. In this case it was more methodological
question of how to loop names in merge() function.
I solved this very simply buy renaming specific columns after I have
ran merge().
Thank you for
Please read the last line of every message to r-help.
In particular simplify this as much as possible and
construct some small artificial test data to illustrate.
Anyways, func is probably not what you want.
It has the same effect as
func <- function(x, j) x[72+j] + [144+j]
On Wed, Jul 15, 2009
Hello everyone,
Say I have defined a convenience function in my code like this:
func <- function(x, j){
x[168+j] <- x[72+j]+x[144+j]
}
And now I apply it to some columns in a big zoo object like this:
for (m in 1:24){
combined <- merge(combined, LA1sum=apply(combined, 1, func,
3 matches
Mail list logo