Sharing R code
Sharing software code produced during a research project has become standard procedure in many fields. In addition, publishers and funding agencies may require you to share your code as a provision for article publication or as part of your research grant.
The Stanford Digital Repository (SDR) is an excellent option for sharing software code. The SDR is a Stanford University Libraries service that allows you to upload your files along with descriptive information into our preservation system. Your content will be assigned a persistent identifier, much like a DOI, and will be available at a persistent URL, or PURL. By doing this you will be making your content easily discoverable and citable by other researchers. You will also be fulfilling funding agency and publisher requirements for making code from your research available. Your content will be included in the Library catalog, which is crawled by Google, making your results available through a Google search.
While you may be storing your code in a public repository like GitHub, the SDR is an excellent complement to that practice, because it allows you to preserve and share the exact version of the content used for a specific publication and to create reciprocal links between the publication and that version of the code.
In addition, you can power visualizations directly in R directly from data stored in the SDR. Check out an example in this blog post!
Below are some examples of R code that have been preserved in the Stanford Digital Repository.
Researchers from Stanford and the University of Melbourne published a paper in Methods in Ecology and Evolution in 2015.
Within the article they include information indicating that the data and R code needed to reproduce the research can be found in the Stanford Digital Repository:
The link to the PURL page takes users to the content in the Stanford Digital Repository:
They also include a reference to where the R package that implements their method can be found on GitHub:
The text above points to this GitHub Repository:
(View in Searchworks)