1

I have func1 and func2

I want to test whether I have put in func1 or func2 into another function Fas an argument

F<-function(FUN){
   if(FUN==func1){
   #do this 
   }else if(FUN==func2){
   #do this 
   }else{
   #do this  
   }
}

Is there a way for me to check FUN==func1 or FUN==func2 so that it returns a logical TRUE or FALSE? This is obviously wrong because == cannot be used to test for function names

Justin Thong
  • 321
  • 3
  • 12
  • Take a look here: http://stackoverflow.com/questions/1567718/getting-a-function-name-as-a-string and see if that gets you where you want. If not, please expand the question with more detail! – Justin Sep 20 '16 at 21:16
  • Relevant post: http://stackoverflow.com/questions/39538431 – zx8754 Sep 20 '16 at 21:55

0 Answers0