On 2025/01/19 01:41, Ivo Welch wrote:
> I often find myself hunting where in my program an error has happened,
> (of course, in R, many error messages are mysterious in themselves,
> too, making it even harder.) the way I do it is mostly with inserting
> `message()` statements.
tried something li
I think I considered doing that many years ago, but one or more of the
following stopped me:
- It will mess up old test scripts that are checking for the old
format error messages.
- Some errors are due to a severe lack of resources (e.g. full stack,
out of some other kind of memory, etc.)
Hi Duncan — Wonderful. Thank you. Bug or no bug, I think it would be
a huge improvement for user-friendliness if R printed the last line by
default *every time* a script dies. Most computer languages do so.
Should I file it as a request for improvement to the R code
development team? Maybe R c
On 2025-01-18 8:27 p.m., Ivo Welch wrote:
I am afraid my errors are worse! (so are my postings. I should have
given an example.)
```
x <- 1
y <- 2
nofunction("something stupid I am doing!")
z <- 4
```
and
```
source("where-is-my-water.R")
Error in nofunction("something stupid I am doing!")
I am afraid my errors are worse! (so are my postings. I should have
given an example.)
```
x <- 1
y <- 2
nofunction("something stupid I am doing!")
z <- 4
```
and
```
> source("where-is-my-water.R")
Error in nofunction("something stupid I am doing!") :
could not find function "nofunction"
``
On 2025-01-18 6:41 p.m., Ivo Welch wrote:
I often find myself hunting where in my program an error has happened,
(of course, in R, many error messages are mysterious in themselves,
too, making it even harder.) the way I do it is mostly with inserting
`message()` statements.
what I would really
I recommend making sure your code is built with functions and using the
debugger and breakpoints (e.g. [1]) to follow the flow of the code to lead you
to where your problem is.
If you are used to building thousand-line top-level scripts then you might not
welcome this suggestion, but in that yo
Hi Ivo,
I maintain 'package:this.path' that I believe does what you want. I
regularly add this to my own code when I need to:
warning(sprintf("remove this later at %s#%d",
this.path::try.this.path(), this.path::LINENO()), call. = FALSE,
immediate. = TRUE)
Of course, modify as needed.
Regards,
great. wonderful. will check it out, and hopefully widely recommend
it (to my students, too). Non-descriptive R error messages have had
most of our school abandon R in favor of python. :-(
On Sat, Jan 18, 2025 at 3:46 PM Iris Simmons wrote:
>
> Hi Ivo,
>
>
> I maintain 'package:this.path' tha
I often find myself hunting where in my program an error has happened,
(of course, in R, many error messages are mysterious in themselves,
too, making it even harder.) the way I do it is mostly with inserting
`message()` statements.
what I would really like to have is a parser that inserted 'curl
10 matches
Mail list logo