Skip to content

[R-pkg-devel] Warning about ggplot although no ggplot is used anywhere in the package

5 messages · Riko Kelter, Duncan Murdoch, Kristian Hovde Liland +1 more

#
Hello everyone,

I ran R CMD check --as-cran without any errors. However, when I run a check on the current version of r-devel I obtain the following strange error about some ggplot function:
* installing *source* package 'fbst' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Warning message:
The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
Please use the `linewidth` argument instead.
The weird thing is: Although my package fbst depends on the package rstanarm which itself imports ggplot,
(1) no package code uses ggplot in any form,
(2) no examples use any ggplot commands and
(3) no vignette uses any ggplot command.

Logs are available at https://win-builder.r-project.org/CX36AbHDU6Tl/
I am thankful for any suggestion why this error occurs.
All the best and kind regards,
Riko
#
On 21/09/2022 5:09 p.m., Riko Kelter wrote:
Could you provide the source for the package?  I can see the DESCRIPTION 
file at win-builder, but can't install it myself since I don't use Windows.

Duncan Murdoch
#
<> The weird thing is: Although my package fbst depends on the package rstanarm which itself imports ggplot,
<> (1) no package code uses ggplot in any form,
<> (3) no vignette uses any ggplot command.
<> I am thankful for any suggestion why this error occurs.
<> All the best and kind regards,
In the NAMESPACE file it looks like you are importing from the 'viridis' package, which again imports 'ggplot', though I am not sure which function you are actually importing as importFrom("viridis", "viridis") does not match any function that I can see is exported by the package. Maybe you are unintentionally invoking a part of ggplot through viridis?

Regards,
Kristian Hovde Liland
#
You could trace the ggplot function using trace(ggplot2::element_line)
and then load the package and run your examples.
Whenever the function is used in the background, it should tell you.
++



On Thu, 22 Sept 2022 at 13:40, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

  
    
#
In rstanarm, the function posterior_vs_prior and pp_validate use
bayesplot::grid_lines which is defined as:

function (color = "gray50", size = 0.2)
{
    theme(panel.grid.major = element_line(color = color, size = size),
        panel.grid.minor = element_line(color = color, size = size *
            0.5))
}

so bayesplot seems to be the culprit if you use these functions.



On Thu, 22 Sept 2022 at 13:51, Alexandre Courtiol <
alexandre.courtiol at gmail.com> wrote: