Pass variable name to a function in r
- by Misha
Is it possible to pass just a variable name in a function call and have it utilised as such within the function??
pseudocode:
q<-function(A){
b<-(w%in%A.2|w%in%A.7)
factor(b,levels=c(F,T),labels=c("non-"A,A))}
w<-c(0:10)
e.2<-c(1,2)
e.7<-c(6,7)
what I´d like to do is
q(e)
and have returned
…