Hello! I wouldl ike to ask you if R supports step by step execution. I have written some nested loops and I would like to check on every step what are the values of some variables. Printing all the variables just creates a really big output of numbers. Could you please give some debugging tutorial that included the aforementioned functionalities? |Moreover can you please tell me how I can concatenate variables and strings so to print some debugging messages / "The value of x is " + x + " and the value of y is " +y. Best Regards Alex [[alternative HTML version deleted]]
Hello On Fri, Oct 22, 2010 at 11:33 AM, Alaios <alaios at yahoo.com> wrote:> I wouldl ike to ask you if R supports step by step execution. ?I have written > some nested loops and ?I would like to check on every ?step what are the values > of some variables. >> fortune('browser')My solution when I run into mysteries like this is to put 'browser()' in the function just before or after the line of interest. The magnitude and direction of my stupidity usually become clear quickly. -- Patrick Burns R-help (February 2006) Then check the help page for related functions. Regards Liviu> Printing all the variables ?just creates a really big output > of numbers. > > Could you please give some debugging tutorial that included the aforementioned > functionalities? > > > |Moreover can you please tell me how I can concatenate variables and strings so > to print some debugging messages / > "The value of x is " + x + " and the value of y is " +y. > > > Best Regards > Alex > > > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
Alaios <alaios at yahoo.com> writes:> > Hello! > I wouldl ike to ask you if R supports step by step execution. I have written > some nested loops and I would like to check on every step what are the values > of some variables. Printing all the variables just creates a really big output > of numbers. > > Could you please give some debugging tutorial that included the aforementioned > functionalities? >At your command prompt type: help(browser) Alternatively you can use the debug library: http://cran.r-project.org/web/packages/debug/index.html> |Moreover can you please tell me how I can concatenate variables and strings so > to print some debugging messages / > "The value of x is " + x + " and the value of y is " +y. >message <- paste("The value of x is ",x," and the value of y is ",y,sep="") print(message) -- aleblanc
On Oct 22, 2010, alais wrote:>> |Moreover can you please tell me how I can concatenate variables >> and strings so >> to print some debugging messages / >> "The value of x is " + x + " and the value of y is " +y.Commas, not "+"" cat("The value of x is ", x , " and the value of y is " , y) -- David Winsemius, MD West Hartford, CT