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 8935893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:05:39+00:00 2026-06-15T10:05:39+00:00

Sometimes you throw multiple browser s into a function to debug. I know you

  • 0

Sometimes you throw multiple browsers into a function to debug. I know you can exit the whole shebang with Q but what if you want to exit the second browser (see below’s code) and return to the first level of browser? I’ve heard type c but that doesn’t exit the second level browser.

FUN <- function() {
browser()                      #first one
    lapply(1:10, function(x) {
browser()                      #second one
        return(x)
    })
}

FUN()
  • 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-06-15T10:05:40+00:00Added an answer on June 15, 2026 at 10:05 am

    I agree with Josh and would like to suggest these two alternatives to your current code:

    1) debugonce: If we call foo your inner function, then debugonce(foo) will launch the debugger only the first time that foo is called, when x==1.

    FUN <- function() {
      browser()
      foo <- function(x)return(x)
      debugonce(foo)
      lapply(1:10, foo)
    }
    

    2) debug and undebug. After you run debug(foo), the debugger will be launched every time foo is called, and until you run undebug(foo):

    FUN <- function() {
      browser()
      foo <- function(x)return(x)
      debug(foo)
      lapply(1:10, foo)
    }
    

    When you want to stop debugging foo, type undebug(foo) before hitting c and it will take you back to the first level browser.

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

Sidebar

Related Questions

Exceptions are wonderful things, but I sometimes worry that I throw too many. Consider
We allow users to write code which sometimes calls jQuery.ready(function(){..}) multiple times. It seems
Sometimes I dont know witch type of exception should I throw. So I usually
Sometimes I want to have temporary comments fully left justified on a line (//)
Sometimes it would be useful to know whether the compiler requires a pre-compiled header
I have not had much experience with VBA, but I sometimes use it at
I really hate sometimes how IDictionary<TKey, TValue> [key] will throw an exception if the
Sometimes I need to insert into the table some null values, or update them
When I am building a gui in NetBeans on a Mac, sometimes I want
I want to remove whole ListviewItems in my Listview except first Column. I have

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.