R-language: how to clear frames / stack in Rstudio / console

On the stack, I refer to the output of traceback () on error. How to "clear the stack", so you get "No trace" from traceback ()? thanks

+4
source share
2 answers

This can be done by overwriting the .Traceback variable, which is currently stored in the base namespace:

 stop("Hammer Time!") Error: Hammer Time! traceback() 1: stop("Hammer Time!") assign(".Traceback",NULL,"package:base") traceback() No traceback available 

Be careful:

It is undocumented where .Traceback or its visibility is stored, and this is subject to change.

+5
source

you can always do it

  getOption(showWarnCalls, FALSE) getOption(showErrorCalls, FALSE) 
0
source

Source: https://habr.com/ru/post/1482401/


All Articles