Rmarkdown should be a markup language or lines of R in .Rmd files should count towards R programming language #5263
Replies: 5 comments
-
Currently github considers Rmd files "prose," but there are situations where this makes for confusing language summary results. This repo is written almost entirely in .Rmd, but the language summary describes it as mostly javascript and zero R. |
Beta Was this translation helpful? Give feedback.
-
RMarkdown is already a language in that Linguist already knows about it and has an entry for it as pointed out in my comment at #4119 (comment) I think what you mean is having it considered as I'm apprehensive about doing this for precisely the reason @Alhadis mentioned:
To add to this apprehension, RMarkdown was added well over 7 years ago (as markup but then changed to prose the very next day without a PR) and this is the first request for this change. Suddenly changing it now will surprise a lot of long time users and not necessarily in a good way. As such, I think we can keep this issue open for a while to see if it gains any traction with others wanting the same behaviour, but I'm not confident nor sure this is the right thing to do in the long run.
As mentioned in #4119, you'll need to implement an override if you want your files to show in the stats. |
Beta Was this translation helpful? Give feedback.
-
Regarding the concern that counting Rmd lines might distort language percentages strangely, I think this is a reasonable concern. On the one hand:
The above actually isn't true for Rmd. Jupyter files are stored as json, whereas .Rmd are stored as plain text markdown, so there won't be inflation by metadata. On the other hand, Rmarkdown documents are often used as instructional pieces so they do tend to be "inflated" by a lot of actual prose. Another option to consider might be to actually count lines of code within Rmarkdown documents that are explicitly R code chunks, and have that total contribute to the R language count. This would be more work than just counting lines of .Rmd to its own language (although doable https://www.r-bloggers.com/2018/05/create-code-metrics-with-cloc/), but is probably the safest and most reasonable approach to better reflect programming language use in repos given the concerns that you've raised. |
Beta Was this translation helpful? Give feedback.
-
I think you may have hit the nail on the head there as to why this was switched to
... is not possible. This is the same issue peeps have had with Jupyter as some want it shown as Python and not Jupyter. I think the same explanation and solution I provided at #3316 (comment) applies here. |
Beta Was this translation helpful? Give feedback.
-
@lildude @myoung3 I did a very rough calculation of how much R-code there is in .Rmd files (as oposed to prose) (see here) It seems that there is a lot of R code in .Rmd files (about 15% in lines of code) and there is about as much .Rmd files as .R scripts in top R-language repositories in github. These numbers makes me think it is perhaps worth reconsidering if .Rmd should count as R code. |
Beta Was this translation helpful? Give feedback.
-
Yes, I read #4119, but given that Jupyter notebooks are considered a language , Rmarkdown should be as well.
Beta Was this translation helpful? Give feedback.
All reactions