Created
          January 2, 2017 01:13 
        
      - 
      
 - 
        
Save wilkox/15d611dbd57fe2f4fd981d4708e1fb12 to your computer and use it in GitHub Desktop.  
  
    
      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
    
  
  
    
  | # Vectorised version of ggtree::expand | |
| require(ggtree) | |
| expand_vectorised <- function(tree_view = NULL, nodes) { | |
| if (length(nodes) == 1) { | |
| return(ggtree::expand(tree_view, nodes)) | |
| } else { | |
| return(ggtree::expand( | |
| expand_vectorised(tree_view, nodes[-1]), | |
| nodes[1] | |
| )) | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment