Skip to content
Prev 105473 / 398506 Next

passing an argument to a function which is also to be a dataframe column name

I think you want

scoring <- function(x, A){
    nm <- deparse(substitute(A))
    x[, nm] <- rowSums(x[, A])
    x
}
On Sun, 3 Dec 2006, Gary Collins wrote: