title: passing arguments to geom_point2 with mapply
body: <p>My objective is pass lists as arguments to the function geom_point2 using lapply or analogously mapply. In similar situations, I had success passing a list (or lists) to geom_cladelabel as in:</p>
  
  <pre><code>mapply(function (x,y,z,w,v,u,t,s) geom_cladelabel(node=x, label=y,
  align=F, etc. # Where x y z etc are lists. 
  </code></pre>
  
  <p>Problem is related to the use of  <code>aes</code> inside geom_point2. (not in geom_cladelabel):</p>
  
  <p>In the case of geom_point2, the node info is inside <code>aes</code>, and I could't do it. Normally I do not get any error message, but it does not work.</p>
  
  <p>The objective is to make this example work, but using mapply instead of writting <code>geom_point2</code> two times.</p>
  
  <pre><code># source("https://bioconductor.org/biocLite.R")
  # biocLite("ggtree")
  library(ggtree)
  library(ape)
  #standard code
  newstree&lt;-rtree(10)
  node1&lt;-getMRCA(newstree,c(1,2))
  node2&lt;-getMRCA(newstree,c(3,4))
  ggtree(newstree)+ 
  geom_point2(aes(subset=(node ==node1) ), fill="black", size=3, shape=23)+
  geom_point2(aes(subset=(node ==node2) ), fill="green", size=3, shape=23)
  
  #desire to substitute the geom_point2 layers with mapply or lapply:
  #lapply(c(node1,node2), function (x) geom_point2(aes(subset=(node=x)))))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9RJnu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9RJnu.jpg" alt="enter image description here"></a></p>