[R] setBreakpoint No source refs found

Duncan Murdoch murdoch.duncan at gmail.com
Thu Dec 18 10:41:51 CET 2014

On 17/12/2014, 9:35 PM, Andre Mikulec wrote:
> Hi,
> when I am trying to deug a package, I am getting the error.
>> library(quantstrat)
>> setBreakpoint("strategy.R#3",envir=environment(strategy))
> No source refs found.
> In R studio, I get a strange message, "Breakpoints will be activated when an updated version of the quantstrat package is loaded."
> However, when I do Hmisc, everything works fine.
>> library(Hmisc)
>> setBreakpoint("F:\\ProgramFiles\\R\\R-3.1.1\\library\\HmiscSRC\\R\\Misc.s#1221", env=environment(hdquantile)) 
> F:\ProgramFiles\R\R-3.1.1\library\HmiscSRC\R\Misc.s#1221:
>  hdquantile step  2 in <environment: namespace:Hmisc>
>  hdquantile step  2 in <environment: package:Hmisc>
>  Tracing function "hdquantile" in package "namespace:Hmisc"
> Tracing function "hdquantile" in package "Hmisc"
> Also, I can set "RStudio breakpoints" in R Studio on many lines in Misc.s
> What is this error, "No source refs found."
> Please help.

The "source refs" are debugging information that by default is added to
functions you load via source(), but not to functions in a package,
because it makes the image noticeably bigger.  You can add it to package
code by setting an environment variable during the INSTALL:  the
variable is "R_KEEP_PKG_SOURCE=yes".  Presumably RStudio is telling you
it needs to re-install the package to get this information.

Duncan Murdoch

More information about the R-help mailing list