partial argument match warning when using ggplot2 with plotly

Hi! I'm getting this warning every time I use ggplot2 with plotly (using either alone is fine), even when I use an example from the ggplotly help page:

19

But the warning isn't there when I make a reprex (see below).

When I googled the error, I saw there was a similar problem with ggsave, and fixing it involved changing the file argument to filename. I'm not sure if something similar is going on in plotly's dev_fun function or if there's something wrong on my side, so I thought I should ask here..

Thanks in advance! :slight_smile:

Reprex:

library(ggplot2)
library(plotly, warn.conflicts = FALSE)
ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
ggplotly(ggiris)

    sessioninfo::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.5.0 (2018-04-23)
#>  os       OS X El Capitan 10.11.6     
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_GB.UTF-8                 
#>  ctype    en_GB.UTF-8                 
#>  tz       Europe/Berlin               
#>  date     2019-03-02                  
#> 
#> ─ Packages ──────────────────────────────────────────────────────────────
#>  package     * version    date       lib
#>  assertthat    0.2.0      2017-04-11 [1]
#>  callr         3.1.1      2018-12-21 [2]
#>  cli           1.0.1      2018-09-25 [1]
#>  colorspace    1.4-0      2019-01-13 [1]
#>  crayon        1.3.4      2018-12-24 [1]
#>  crosstalk     1.0.0      2016-12-21 [2]
#>  data.table    1.12.0     2019-01-13 [1]
#>  digest        0.6.18     2018-10-10 [1]
#>  dplyr         0.8.0.1    2019-02-15 [1]
#>  evaluate      0.13       2019-02-12 [1]
#>  ggplot2     * 3.1.0.9000 2019-03-02 [1]
#>  glue          1.3.0      2018-07-17 [1]
#>  gtable        0.2.0      2016-02-26 [2]
#>  highr         0.7        2018-06-09 [2]
#>  htmltools     0.3.6      2017-04-28 [1]
#>  htmlwidgets   1.3        2018-09-30 [1]
#>  httpuv        1.4.5.1    2018-12-18 [1]
#>  httr          1.4.0      2018-12-11 [1]
#>  jsonlite      1.6        2018-12-07 [1]
#>  knitr         1.21       2018-12-10 [1]
#>  labeling      0.3        2014-08-23 [2]
#>  later         0.8.0      2019-02-11 [1]
#>  lazyeval      0.2.1      2017-10-29 [2]
#>  magrittr      1.5        2014-11-22 [1]
#>  mime          0.6        2018-10-05 [1]
#>  munsell       0.5.0      2018-06-12 [2]
#>  pillar        1.3.1.9000 2019-01-19 [1]
#>  pkgconfig     2.0.2      2018-08-16 [1]
#>  plotly      * 4.8.0.9000 2019-03-01 [1]
#>  processx      3.2.1      2018-12-05 [2]
#>  promises      1.0.1      2018-04-13 [1]
#>  ps            1.3.0      2018-12-21 [2]
#>  purrr         0.3.1      2019-03-01 [1]
#>  R6            2.4.0      2019-02-14 [1]
#>  Rcpp          1.0.0.3    2019-02-27 [1]
#>  rlang         0.3.1      2019-01-08 [1]
#>  rmarkdown     1.11       2018-12-08 [1]
#>  scales        1.0.0      2018-08-09 [2]
#>  sessioninfo   1.1.1      2018-11-05 [2]
#>  shiny         1.2.0      2018-11-02 [1]
#>  stringi       1.3.1      2019-02-13 [1]
#>  stringr       1.4.0      2019-02-10 [1]
#>  tibble        2.0.1.9001 2019-02-27 [1]
#>  tidyr         0.8.2      2018-10-28 [1]
#>  tidyselect    0.2.5      2018-10-11 [1]
#>  viridisLite   0.3.0      2018-02-01 [2]
#>  webshot       0.5.1      2018-09-28 [1]
#>  withr         2.1.2.9000 2019-01-26 [1]
#>  xfun          0.5        2019-02-20 [1]
#>  xtable        1.8-3      2018-08-29 [1]
#>  yaml          2.2.0      2018-07-25 [1]
#>  source                            
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.2)                    
#>  Github (r-lib/crayon@74bee76)     
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.2)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.2)                    
#>  Github (tidyverse/ggplot2@9df0a07)
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.2)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  Github (r-lib/pillar@3a54b8d)     
#>  CRAN (R 3.5.0)                    
#>  Github (ropensci/plotly@6aa3717)  
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  Github (tidyverse/purrr@d5a59ff)  
#>  CRAN (R 3.5.2)                    
#>  Github (RcppCore/Rcpp@08344ae)    
#>  CRAN (R 3.5.2)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.2)                    
#>  CRAN (R 3.5.2)                    
#>  Github (tidyverse/tibble@92f5604) 
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#>  Github (r-lib/withr@be57595)      
#>  CRAN (R 3.5.2)                    
#>  CRAN (R 3.5.0)                    
#>  CRAN (R 3.5.0)                    
#> 
#> [1] /Users/sowlarn/Library/R/3.5/library
#> [2] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

Created on 2019-03-02 by the reprex package (v0.2.1)

I can't reproduce the error. Our differences are that I'm on Mojave and 3.5.2, but first, it would be good to check

other attached packages:
[1] plotly_4.8.0  ggplot2_3.1.0

to see if that helps.

1 Like

Thank you @technocrat! :slight_smile: I removed and reinstalled the packages, but I'm still getting the same error..

02

Inspired by you, I also tried on another OS X El Capitan 10.11.6, with R version 3.4.1, plotly_4.8.0 and ggplot2_3.1.0, and couldn't reproduce the error either.. I'll try with some other computers tomorrow :slight_smile:

1 Like

This warning for partial matching is not an issue per-se. It doesn't mean something wrong with the installed.

By defaut, R accepts partial matching for attributes, arguments and selection with $ (x$something). There is some option in R you can activate to warn you when this happens : warnPartialMatchAttr, warnPartialMatchDollar and warnPartialMatchArgs. You'll find them in the list inside ?options

Can you check the result of getOption("warnPartialMatchArgs") in your session where you have the warning?
I think it could have been set to TRUE, meaning the option is activated and it will warn when there is partial matching happening.

The dev.fun function is either Cairo::Cairo, grDevices::png, grDevices::jpeg depending on the computer capabilities where it is run. (see code. If you look at these function, some are taking file argument, other filename. You could have the warning because dev.fun(file = ...) maybe be in fact a function that take filename =. (like grDevices::png(). So the reproducibility depends on the system and on the warning activattion or not.

5 Likes

Thank you so much @cderv! You’re absolutely right, my warnPartialMatchArgs was set to TRUE and that's why the reprex didn’t reproduce my warning! :slight_smile: I also didn't know you can link to specific lines in a file on github like that! :+1:

For completeness, here's a reprex that reproduces my warning:

options(warnPartialMatchArgs = TRUE)
library(ggplot2)
library(plotly, warn.conflicts = FALSE)
ggplotly(ggplot(mtcars, aes(wt, mpg)) + geom_point())
#> Warning in dev_fun(file = tempfile(), width = width %||% 640, height =
#> height %||% : partial argument match of 'file' to 'filename'

Created on 2019-03-03 by the reprex package (v0.2.1)

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.