Skip to content
Prev 273763 / 398506 Next

function - access column

Perhaps something like this:

Test <- function(m){
     m <- if(is.character(m)) get(m) else m
     stopifnot(length(colnames(m))>0)
     n = colnames(m)
     # Process n however
     2* m[, n]
}

That make sense?

Hope it helps,
Michael
On Oct 7, 2011, at 11:03 AM, Ana <rrasterr at gmail.com> wrote: