Use of pkg::fun in the Rstudio Browse console

I've been having this weird error many times and I don't know if it's a bug or if I am doing something wrong...

What I know is that when I enter the debugger (via browser() function in the code normally) and I jump in the console to run some ideas for my code suddenly this message appears and I have to quit the debugger.

debugging in: purrr::map
debug: {
    pkg <- as.character(substitute(pkg))
    name <- as.character(substitute(name))
    getExportedValue(pkg, name)
}

I am pretty sure this happens when I try to run pkg::fun and autocomplete with the tabulator key. I guess this can be also a R issue (not just Rstudio) but thought someone may give some light in what i am doing wrong here.

How to reproduce?

  1. Enter in debugger mode
> test <- function(variables) {
+   browser()
+ }
> test()
Called from: test()
  1. write dplyr:: and then press the tabulator key 2 times.

When I do this I get:

debugging in: dplyr::add_count
debug: {
    pkg <- as.character(substitute(pkg))
    name <- as.character(substitute(name))
    getExportedValue(pkg, name)
}

EDIT

I noticed that the first autocomplete works fine but when trying again to get the arguments of that function (this is what I do in the editor normally) then it breaks. So you have to actually press tab key 2 times.

Thanks for the clear explanation. Unfortunately, I can't reproduce...
Which RStudio version are you using ? Have you tried with last ones ?

1 Like

Sorry I missed that.

Okay, so this happens in my Rstudio installation at work. In my personal mac (1.2.719) works as expected. I will try to update the version there and come back here if it fails.

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