Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6047101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:18:51+00:00 2026-05-23T07:18:51+00:00

I have an elaborate script that spans multiple functions (and files). For debugging purposes

  • 0

I have an elaborate script that spans multiple functions (and files). For debugging purposes I need to embed browser calls into all sorts of nooks and crannies. When I presumably fix something, I want to run the whole thing without debugging, ergo avoiding browser calls because commenting out all browser calls would mean a considerable effort from my part. @mdsumner on R chat suggested running the script in non-interactive mode (i.e. using Rscript.exe on Windows) but I would benefit from having that done in my console, to be able to access for instance traceback. I have gone through browser docs and I can find no option that would come close to what I’m trying to achieve. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:18:52+00:00Added an answer on May 23, 2026 at 7:18 am

    Here are three possibliities:

    1) Overwrite browser command. Add this command to your global workspace to turn the browser commands off:

    browser <- list
    

    and to turn it back on

    rm(browser)
    

    This is probably the easiest but is a bit ugly due to the browser variable being left in the global environment.

    The next two solutions are slightly longer but use options instead so that no new variables are introduced into the global environment. Also they are such that if no options are set then no debugging is done so you only have to set an option if you want debugging. The if solution may be faster than the expr solution although its likely not material.

    2) Use expr= argument with option. Replace each browser command with:

    browser(expr = isTRUE(getOption("Debug")))
    

    and then define the "Debug" option to be TRUE to turn debugging on.

    options(Debug = TRUE)
    

    or set it to something else or remove it to turn debugging off:

    options(Debug = NULL)
    

    3) Use if with an option. Replace each browser command with:

    if (isTRUE(getOption("Debug"))) browser()
    

    and then set the Debug option or not as in the prior point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a portion of a bash script that is getting a filename without
I have a directory: Audio/ and in that will be mp3 files only. I'm
I have a script that appends some rows to a table. One of the
Need to load data from a single file with a 100,000+ records into multiple
I know the title isn't very elaborate, but I have tried this multiple times
Have you managed to get Aptana Studio debugging to work? I tried following this,
Let me elaborate on the question... I have a custom CMS (built on codeigniter
Like many people, I have several SVN repositories that contains several projects. I've decided
I have a function that reads user input from std::cin, and I want to
I have a page with mp3s that are playable from a player, and there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.