-
-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnamed chunk numbering inconsistency (RStudio vs Knitr) #2232
Comments
Currently unamed chunk in knitr are counted among unnamed chunk, and it does not take into account named chunk Lines 168 to 171 in 78f1db5
@yihui I wonder if counting considering all chunks could break something. Unnamed chunk number are quite internal... @zeehio Naming all the chunk is still the best way to track chunks explicitly. Unnamed chunk are named internally because a name is required for some features. So this is somehow related to #2228 where a function could explicitly name all the unnamed chunks. |
It is a low hanging fruit if a document doesn't contain child documents. When child documents are involved, I'm not sure how to number unnamed chunks. One idea is to append numbers to the label of the current chunk that contains child documents, e.g., I think one way to improve the progress reporting is to add the line numbers after the chunk label. That info should make the progress much clearer.
Yes. |
Thanks for your replies. I've made a minimal pull request on #2250 to include the line number (and the file name, since we have child documents) into the progress bar. If this idea is not convincing to you I have no issues in closing the pull request or changing it at your convenience. Thanks for your time :-) |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Thank you for your work on your packages. I am reporting here a mildly annoying issue:
Unnamed chunks receive different numbers depending on whether RStudio browsing menu is used or knitr is knitting. This inconsistency is mildly annoying, because it makes it a bit difficult to figure out where is knitr knitting.
(Full Rmd available in this gist: https://gist.github.com/zeehio/9b631e5b25ff9b1ddeeed2ffe2b64436)
In this image, the first and second chunks are named. The third one is unnamed. RStudio labels the third chunk in the dropdown menu as "Chunk3", while
knitr::knit()
labels it asunnamed-chunk-1
.On larger Rmd documents with some named and some unnamed chunks, when knitr gets stuck on a chunk that is unexpectedly slow, I often try to figure out what chunk it is to address the performance bottleneck.
I think the RStudio numbering makes more sense to me, so I am filling the bug here. However, an alternative would be to patch RStudio so unnamed chunks appear as
"Chunk 3: unnamed-chunk-1"
so I can tell where to go.Not a pressing issue, but if it is a low hanging fruit I'd love to see it fixed.
Session info:
Thanks for your time reading this issue and thank you for considering addressing this.
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: