How can I call matrix$col, inside a function?
The matrix name is one of the variables of the function, while the
column name I get by assuming that it should have a certain
characters.

something like this

function(matrix){
colname=as.name(grep("[A-T a-t]ting",colnames(matrix),value=TRUE))
output=2*(matrix$colname)
return(output)
}

The name of the column is Testing.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to