AKshayKulkarni
AKshayKulkarni

Reputation: 57

inconsistency in debug package in r

I am using the debug package in r to debug my code. I am testing the mtrace function in debug:

> require(debug)
Loading required package: debug
Loading required package: tcltk
> mtrace(ft.debug)

after that, the packages's author claims, if you invoke any function, a window will open where the code is displayed with numbered lines:

> fix(ft.debug)

ft.debug is test function whose code is:

function(){
              print("R is the most wonderful thing in the world")
}

but there is only the normal r function editor window: there is no numbered window.

How do I get the numbered window?

Upvotes: 0

Views: 25

Answers (1)

Katia
Katia

Reputation: 3914

mtrace() only sets the debugging mode. You need to call the function after that:

require(debug)
ft.debug<- function(){
  print("R is the most wonderful thing in the world")
}
mtrace(ft.debug)
ft.debug()

enter image description here

Upvotes: 2

Related Questions