Skip to content

Error resizing a plot window: Error in UseMethod("depth") :

3 messages · Timothy Bates, Brandon Hurr

#
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
#
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

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

devtools::session_info()
Session info
----------------------------------------------------------------------------
 setting  value
 version  R version 3.4.1 (2017-06-30)
 system   x86_64, darwin15.6.0
 ui       AQUA
 language (EN)
 collate  en_US.UTF-8
 tz       America/Los_Angeles
 date     2017-08-29

Packages
--------------------------------------------------------------------------------
 package     * version    date       source
 base        * 3.4.1      2017-07-07 local
 colorspace    1.3-2      2016-12-14 CRAN (R 3.4.0)
 compiler      3.4.1      2017-07-07 local
 cowplot     * 0.8.0      2017-07-30 CRAN (R 3.4.1)
 datasets    * 3.4.1      2017-07-07 local
 devtools      1.13.0     2017-05-08 CRAN (R 3.4.0)
 digest        0.6.12     2017-01-27 CRAN (R 3.4.0)
 ggplot2     * 2.2.1.9000 2017-07-27 Github (tidyverse/ggplot2 at b2b58f1)
 graphics    * 3.4.1      2017-07-07 local
 grDevices   * 3.4.1      2017-07-07 local
 grid          3.4.1      2017-07-07 local
 gtable        0.2.0      2016-02-26 CRAN (R 3.4.0)
 labeling      0.3        2014-08-23 CRAN (R 3.4.0)
 lazyeval      0.2.0      2016-06-12 CRAN (R 3.4.0)
 memoise       1.1.0      2017-04-21 CRAN (R 3.4.0)
 methods     * 3.4.1      2017-07-07 local
 munsell       0.4.3      2016-02-13 CRAN (R 3.4.0)
 plyr          1.8.4      2016-06-08 CRAN (R 3.4.0)
 Rcpp          0.12.12    2017-07-15 cran (@0.12.12)
 rlang         0.1.1.9000 2017-08-01 Github (tidyverse/rlang at ff87439)
 scales        0.4.1.9002 2017-07-27 Github (hadley/scales at 6db7b6f)
 stats       * 3.4.1      2017-07-07 local
 tibble        1.3.3      2017-05-28 cran (@1.3.3)
 tools         3.4.1      2017-07-07 local
 utils       * 3.4.1      2017-07-07 local
 viridisLite   0.2.0      2017-03-24 cran (@0.2.0)
 withr         1.0.2      2016-06-20 CRAN (R 3.4.0)
On Tue, Aug 29, 2017 at 8:26 AM, BATES Timothy <tim.bates at ed.ac.uk> wrote:

            

  
  
#
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>