R and Python are two mainstream data science languages. Except for their powerful data processing ability, another very essential reason is there are numerous opensource packages in Python and R that are contributed by the developer and scientist all over the world. For R, the 17000+ packages as of Feb, 2021 make it very flexible and can be applied to various fields easily.
As a data scientist, things happen a lot when you want to reuse the previous code/data or public your work. Simply uploading your script can be an approach, however, a better resolution is building your own R package, with detailed documentation.
To edit
Based on the book Trustworthy Online controlled experiments