Double-clicking on the error message just brings you to the line number stated, so I usually end up searching for the text that shows up in the error message
I used to basically count lines within my code chunks, but ever since my discovery of r emo::ji(), my use of inline code (and errors therein ) has kind of skyrocketed.
I have no idea what the internals look like for this, and, thus, have no understanding of technical feasibility, but I'm curious if there have been any ideas about how this might be done differently for R Markdown.
My first thought (or second, rather, the first would be not to make mistakes in my code) is just to do away with line numbers all together (I've spent more time trying to discover mistakes in a particular line of text than I should probably admit), but that seems like throwing the baby out with the bathwater.
β¨:wastebasket:
Don't think it's relevant, but just in case, setup info:
Can you share an R Markdown document that exhibits this kind of issue? I believe RStudio retrieves these errors from knitr, which will typically output (e.g. for a chunk which has some error):
Quitting from lines 5-10 (example.Rmd)
Error in eval(expr, envir, enclos) : object 'a' not found
In other words, we get a range from which the error occurred, but not the actual line. Of course, this doesn't seem to be the case in your document so I'm curious if something else is afoot here.
Is this some sort of trick question wherein you went in and magically fixed everything? Because now all my Rmd code chunk ones are totally giving me the right line numbers for errors! And, in the fresh ones I cooked up, if I fail to finish an inline bit of R code it's just printing it as textβ¦
To be updated once I can successfully break things again!