4.1 KiB
R
R is the #22 most popular language according to the 2023 Stack Overflow Developer Survey.
Benchmarks
✅ R is one of the 19 languages in the MultiPL-E benchmark
✅ R is one of the 16 languages in the BabelCode / TP3 benchmark
❌ R is not one of the 13 languages in the MBXP / Multilingual HumanEval benchmark
❌ R is not one of the 5 languages in the HumanEval-X benchmark
Datasets
✅ R is included in The Stack dataset
❌ R is not included in the CodeParrot dataset
❌ R is not included in the AlphaCode dataset
❌ R is not included in the CodeGen dataset
❌ R is not included in the PolyCoder dataset
Stack Overflow & GitHub presence
R has 499,872 tagged questions on Stack Overflow
R projects have had 51,800 PRs on GitHub since 2014
R projects have had 88,649 issues on GitHub since 2014
R projects have had 506,309 pushes on GitHub since 2014
R projects have had 91,654 stars on GitHub since 2014
Anecdotes from developers
It's even helpful for example datasets. If you want to test or play around it will create a dataframe example. Also if you know one programming language it can help translate. It will even rewrite the code to look better. E.g. write this code in python pandas but make it more readable like r dplyr. Anything regex is nice as I don't have to hope a specific example is on stack overflow. Chat cpt from my experience will often favor going things with for loops instead of taking advantage of dplyr or pandas functions. With everything chat gpt tho check the code as it will confidently give you an answer and even print out a fake output. Often pointing out its error gets chatgpt to fix the code.
I have found it hit and miss. I was able to knock up simple Shiny apps in a minute (https://youtu.be/8oJ1HtkpDt0) but have had it write non-sense code for some other things I was trying (especially webscraping). GPT Studio is pretty good (demo here https://youtu.be/QQfDTLExoNU) but has someone else mentioned, take a look at Github Copilot
I do it constantly, not only for debugging which it is spectacular at, but for especially tedious things like using ggplot. If you can think it, GPT-4 and the other specialized models can code it. The real key is to put thought into the question you want to answer with the code and then to very deliberately tell the GPT what to do. For example, “I have a data frame with x, y, z variables. Please write R code to perform a, b, c statistical analysis. Place the results into a variable called results.” And so on.