Last active
          June 3, 2017 09:54 
        
      - 
      
 - 
        
Save jjesusfilho/a8679e4d3a467ef6bd7db4ce6b8dd689 to your computer and use it in GitHub Desktop.  
    Wraper da função ifelse do R.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ifs<-function(x,y,z=NULL){ | |
| stopifnot(is.list(y)) | |
| #if(length(z)==0) {z<-x} | |
| for(i in 1:length(y)){ | |
| x<-ifelse(stringr::str_detect(x,y[[i]][1]),y[[i]][2],x) | |
| } | |
| return(x) | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment