Skip to content

no symbol named 'X' in scope #7318

Open

Description

@ivan-paleo

In my code, I have this warning at every line where I use a function that is not part of base R, e.g. tools::md5sum() (even though tools is loaded automatically via a namespace), reshape2::melt(), ggplot2::ggplot() and so on.

screenshot_RStudio

Once I run the library(package) command, this warning disappears with a slight delay. But it does not disappear if this is part of a project using the package renv. So I'm not sure whether it's an issue with RStudio in general or renv in particular.

I use RStudio 1.3.959.
Here my sessionInfo() of the project using renv:

R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] tools stats graphics grDevices datasets utils methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.2 rstudioapi_0.11 yaml_2.2.1 tinytex_0.24 crayon_1.3.4
[6] xfun_0.15 renv_0.11.0

Activity

  1. added this to the v1.4 milestone on Jul 10, 2020
  2. kevinushey commented on Jul 10, 2020

    @kevinushey
    Collaborator

    Thanks for the bug report. I've reproduced this locally as well.

    To reproduce, first ensure that all R diagnostics are enabled:

    Screen Shot 2020-07-10 at 8 55 40 AM

    Then, create a new RStudio project using renv (e.g. via the New Project dialog), then create an R document with the contents:

    library(tools)
    md5sum()
    

    Save that document. Upon save, you should see the false positive emitted:

    Screen Shot 2020-07-10 at 8 55 56 AM

    (Note: I was also able to reproduce without using renv at all...)

  3. ivan-paleo commented on Jul 13, 2020

    @ivan-paleo
    Author

    In my session, when I run library(tools), the warning disappears, except if it is in a project using renv.

  4. modified the milestones: v1.4, Later on Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions