[R-SIG-Mac] Error resizing a plot window: Error in UseMethod("depth") :

BATES Timothy tim.bates at ed.ac.uk
Wed Aug 30 13:34:06 CEST 2017


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.hurr at gmail.com<mailto:brandon.hurr at 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.bates at ed.ac.uk<mailto:tim.bates at 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170830/80631a87/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170830/80631a87/attachment.ksh>


More information about the R-SIG-Mac mailing list