File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ setChildren <- function(x, children) {
264264  }
265265  if  (length(children )) {
266266    x $ children  <-  children 
267-     childNames  <-  sapply (children , childName )
267+     childNames  <-  vapply (children , childName ,  " " 
268268    names(x $ children ) <-  childNames 
269269    x $ childrenOrder  <-  childNames 
270270  } else  {
@@ -331,7 +331,7 @@ getName <- function(elt) {
331331
332332getNames  <-  function () {
333333  dl  <-  grid.Call(C_getDisplayList )[1L : grid.Call(C_getDLindex )]
334-   names  <-  sapply (dl , getName )
334+   names  <-  vapply (dl , getName ,  " " 
335335  names [nzchar(names )]
336336}
337337
Original file line number Diff line number Diff line change @@ -756,7 +756,7 @@ grobPathListing <- function(x, ...) {
756756
757757#  Tidy up the vpPath from grid.ls() to remove ROOT if it is there
758758clean  <-  function (paths ) {
759-     sapply (lapply(paths ,
759+     vapply (lapply(paths ,
760760                  function (x ) {
761761                      pieces  <-  explode(x )
762762                      if  (length(pieces ) &&  pieces [1 ] ==  " ROOT" 
@@ -767,7 +767,8 @@ clean <- function(paths) {
767767               if  (length(x ))
768768                   as.character(vpPath(x ))
769769               else  " " 
770-            })
770+            },
771+            " " 
771772}
772773
773774#  Given a gPath, return complete grob paths that match from the display list
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ depth.vpList <- function(x, ...) {
233233depth.vpStack  <-  function (x , ... ) {
234234  #  Elements in the stack may be vpStacks or vpLists or vpTrees
235235  #  so need to sum all the depths
236-   sum(sapply (x , depth , ... ,  simplify = TRUE ))
236+   sum(vapply (x , depth , 0 ,  ... ))
237237}
238238
239239depth.vpTree  <-  function (x , ... ) {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments