Re: [R] line numbers

2006-01-29 Thread Gabor Grothendieck
Check out ?sprintf, ?cat, ?noquote, ?format, ?formatC, ?print. Also maybe ?sub, ?gsub, ?chartr, ?grep. To view the code that prints summary(lm(...whatever...)), put this on a line by itself: stats:::print.summary.lm The summary statement mentioned above outputs an object of class "summary.lm"

[R] line numbers

2006-01-29 Thread Pogoda, Wendy
I am using the sink function to save several results (i.e. values of many different variables) to an output file. However, the output looks unattractive because it displays line numbers next to each new variable, it is difficult to remove the R variable name from the output, and I cannot print

Re: [R] line numbers and file names in error messages

2005-04-15 Thread Jan T. Kim
On Fri, Apr 15, 2005 at 12:37:46PM -0400, Gabor Grothendieck wrote: > On 4/15/05, Jan T. Kim <[EMAIL PROTECTED]> wrote: > > On Fri, Apr 15, 2005 at 11:27:13AM -0400, Gabor Grothendieck wrote: > > > On 4/15/05, Vivek Rao <[EMAIL PROTECTED]> wrote: > > > > Many of my R scripts call other R scripts us

Re: [R] line numbers and file names in error messages

2005-04-15 Thread Gabor Grothendieck
On 4/15/05, Jan T. Kim <[EMAIL PROTECTED]> wrote: > On Fri, Apr 15, 2005 at 11:27:13AM -0400, Gabor Grothendieck wrote: > > On 4/15/05, Vivek Rao <[EMAIL PROTECTED]> wrote: > > > Many of my R scripts call other R scripts using the > > > source function. If there is a syntax error in one of > > > th

Re: [R] line numbers and file names in error messages

2005-04-15 Thread Jan T. Kim
On Fri, Apr 15, 2005 at 11:27:13AM -0400, Gabor Grothendieck wrote: > On 4/15/05, Vivek Rao <[EMAIL PROTECTED]> wrote: > > Many of my R scripts call other R scripts using the > > source function. If there is a syntax error in one of > > the scripts, I get an error message such as > > > > Error in

Re: [R] line numbers and file names in error messages

2005-04-15 Thread Gabor Grothendieck
On 4/15/05, Vivek Rao <[EMAIL PROTECTED]> wrote: > Many of my R scripts call other R scripts using the > source function. If there is a syntax error in one of > the scripts, I get an error message such as > > Error in parse(file, n, text, prompt) : syntax error > on line 1 > > but the name of the

[R] line numbers and file names in error messages

2005-04-15 Thread Vivek Rao
Many of my R scripts call other R scripts using the source function. If there is a syntax error in one of the scripts, I get an error message such as Error in parse(file, n, text, prompt) : syntax error on line 1 but the name of the file where the error occurs is not given. Other error messages s

Re: [R] Line numbers in error messages

2004-04-12 Thread Thomas Lumley
On Mon, 12 Apr 2004, Tony Plate wrote: > Isn't source file information often recorded in the "source" attribute on > functions (or calls)? Could either the execution engine or the debugger > refer to that information? (Though, in the debugger it might be impossible > to uniquely identify express

Re: [R] Line numbers in error messages

2004-04-12 Thread Patrick Connolly
On Mon, 12-Apr-2004 at 03:20PM -0700, Webb Sprague wrote: |> Hi Patrick, |> |> >It's very simple using a browser() line in your function somewhere you |> >know your code's OK, then run line by line. |> > |> The problem is that sometimes you have code of a few hundred lines, to |> which you hav

Re: [R] Line numbers in error messages

2004-04-12 Thread Tony Plate
Isn't source file information often recorded in the "source" attribute on functions (or calls)? Could either the execution engine or the debugger refer to that information? (Though, in the debugger it might be impossible to uniquely identify expressions that appear multiple times in the functi

Re: [R] Line numbers in error messages

2004-04-12 Thread Duncan Murdoch
On Mon, 12 Apr 2004 15:20:58 -0700, you wrote: >Hi Patrick, > >>It's very simple using a browser() line in your function somewhere you >>know your code's OK, then run line by line. >> >The problem is that sometimes you have code of a few hundred lines, to >which you have added a strange little

Re: [R] Line numbers in error messages

2004-04-12 Thread Thomas Lumley
On Tue, 13 Apr 2004, Jason Turner wrote: > Webb Sprague wrote: > > I already use ESS. If it would give line numbers, my life would be > > perfect! > > It does, if you don't use source(). Have your R code in one buffer, and > the R session running, and (from the code buffer), type C-c C-l. > Yes

Re: [R] Line numbers in error messages

2004-04-12 Thread Jason Turner
Webb Sprague wrote: I already use ESS. If it would give line numbers, my life would be perfect! It does, if you don't use source(). Have your R code in one buffer, and the R session running, and (from the code buffer), type C-c C-l. Cheers Jason __

Re: [R] Line numbers in error messages

2004-04-12 Thread A.J. Rossini
Uwe Ligges <[EMAIL PROTECTED]> writes: > Webb Sprague wrote: >> >> Hi all, >> >> I have searched but to know avail. Is there a way to get a line number >> when a function crashes? I am doing an edit->source->run cycle. > > I don't think so, but traceback(), debug() and options(error = recover)

Re: [R] Line numbers in error messages

2004-04-12 Thread Webb Sprague
Hi Patrick, It's very simple using a browser() line in your function somewhere you know your code's OK, then run line by line. The problem is that sometimes you have code of a few hundred lines, to which you have added a strange little line that craps out because of some silly mistake that wo

Re: [R] Line numbers in error messages

2004-04-12 Thread Uwe Ligges
Webb Sprague wrote: > > Hi all, > > I have searched but to know avail. Is there a way to get a line number > when a function crashes? I am doing an edit->source->run cycle. I don't think so, but traceback(), debug() and options(error = recover) are your friends. Also, you might want to check

[R] Line numbers in error messages

2004-04-12 Thread Webb Sprague
Hi all, I have searched but to know avail. Is there a way to get a line number when a function crashes? I am doing an edit->source->run cycle. Feel free to cc me as I subscribe to the list in digest. Thanks W __ [EMAIL PROTECTED] mailing list https: