Looks like a bug under High Sierra.
Repro
1. Close any open Quartz  graphics window
2. Running the example on the top of the cowplot page you linked.

Obtained:  useMethod("depth") error when the second plot tries to render (no 
need to resize the window)

Running the code a second time (i.e., when an already open graphics window) 
there's no error.

Repro  code:
theme_set(theme_cowplot(font_size=12)) # reduce default font size
plot.mpg <- ggplot(mpg, aes(x = cty, y = hwy, colour = factor(cyl))) +  
geom_point(size=2.5)
plot.diamonds <- ggplot(diamonds, aes(clarity, fill = cut)) + geom_bar() +  
theme(axis.text.x = element_text(angle=70, vjust=0.5))
plot_grid(plot.mpg, plot.diamonds, labels = c('A', 'B'))

Error in UseMethod("depth") :
  no applicable method for 'depth' applied to an object of class "NULL"


sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13

Matrix products: default
BLAS: 
/Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: 
/Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] cowplot_0.8.0   ggplot2_2.2.1   umx_1.8.0       OpenMx_2.7.16-8 
devtools_1.13.3

loaded via a namespace (and not attached):
 [1] Rook_1.1-1         purrr_0.2.3        splines_3.4.1      lattice_0.20-35   
 colorspace_1.3-2   htmltools_0.3.6    viridisLite_0.2.0  XML_3.98-1.9       
rlang_0.1.2
[10] nloptr_1.0.4       glue_1.1.1         withr_2.0.0        
RColorBrewer_1.1-2 bindrcpp_0.2       bindr_0.1          plyr_1.8.4         
stringr_1.2.0      munsell_0.4.3
[19] gtable_0.2.0       visNetwork_2.0.1   htmlwidgets_0.9    memoise_1.1.0     
 labeling_0.3       DiagrammeR_0.9.2   parallel_3.4.1     visreg_2.4-1       
Rcpp_0.12.12
[28] xtable_1.8-2       readr_1.1.1        scales_0.4.1       jsonlite_1.5      
 rgexf_0.15.3       lme4_1.1-13        gridExtra_2.2.1    polycor_0.7-9      
brew_1.0-6
[37] hms_0.3            digest_0.6.12      stringi_1.1.5      dplyr_0.7.2       
 numDeriv_2016.8-1  grid_3.4.1         influenceR_0.1.0   tools_3.4.1        
magrittr_1.5
[46] lazyeval_0.2.0     tibble_1.3.4       tidyr_0.7.0        pkgconfig_2.0.1   
 MASS_7.3-47        Matrix_1.2-10      downloader_0.4     minqa_1.2.4        
assertthat_0.2.0
[55] rstudioapi_0.6     viridis_0.4.0      R6_2.2.2           sfsmisc_1.1-1     
 igraph_1.1.2       nlme_3.1-131       compiler_3.4.1
>

On 29 Aug 2017, at 4:49 pm, Brandon Hurr 
<brandon.h...@gmail.com<mailto:brandon.h...@gmail.com>> wrote:

Tim,

I've run the example code on the page below and resized the plots with no 
errors.

https://cran.r-project.org/web/packages/cowplot/vignettes/plot_grid.html

It may have something to do with running High Sierra, or the specific code/data 
you are using.

Could you post a reproducible example?

Brandon



On Tue, Aug 29, 2017 at 8:26 AM, BATES Timothy 
<tim.ba...@ed.ac.uk<mailto:tim.ba...@ed.ac.uk>> wrote:
Resized a plot window and got this error in the console

Error in UseMethod("depth") :
  no applicable method for 'depth' applied to an object of class "NULL"


The plot was two ggplot2 graphs side by side, made using cowplot::plot_grid()

Set up is
R version: R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0
MacOS: 10.13 Beta (17A352a)


Is there a githuib or other page to log bugs in Mac R.app?

best, tim

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to