Miscellaneous Tools for Reproducible Research

Tools to load 'R' packages and automatically generate BibTeX files citing them as well as load and cache plain-text and 'Excel' formatted data stored on 'GitHub', and from other sources.

Version 0.4.5 CRAN Version Build Status CRAN Monthly Downloads CRAN Total Downloads

Miscellaneous tools for reproducible research

repmis currently has the following functions:

Functions for installing, loading, and citing R packages:

  • LoadandCite: a function for installing and loading R packages. The command also creates a BibTeX bibliography file with package citations.

  • InstallOldPackages: installs specific R package versions.

Functions for loading data into R from the internet:

  • source_data: loads plain-text formatted data (e.g. CSV, TSV) or RDATA stored at a URL (both http and https) into R. Note: the command can download data from almost any secure (https) URL. This includes data in Dropbox Public folders and published Google Docs plain-text formatted data sets (see Google Docs support pages for details. Note, currently only the old Google Sheets supports publishing sheets to the Web as plain-text files.)

    • source_data, and all of the data download commands in repmis find and report SHA-1 hashes for each file it loads. You can use a file's SHA-1 hash to make sure you are downloading the file and version of the file you think you are downloading. Note: if you are using source_data to download data from GitHub, source_data's SHA-1 hash is not the same as the Git commit's SHA-1 hash. (Thanks to Hadley Wickham's devtools package for the code to make this possible.)

    • Data downloaded with source_data can be cached (so you don't have to re-download it every time you run a script. To do this use the cache argument.

  • source_XlsxData: downloads and loads a data set in Excel format. The function relies on the xlsx package and can take any arguments that read.xlsx can.


  • git_stamp: function for get git stamp (commit and branch) for a repository. Thanks to Måns Magnusson.

  • scan_https: read a character text file from a secure (https) site into R as a single object.

  • set_valid_wd: sets valid working directory from vector of possible directories. This is useful if you run the same script on multiple machines.


The package is available for download from CRAN.

You can also download the most recent version using the devtools command install_github to install repmis in R. Here is the exact code for installing the current version:



Version 0.5

Unfortunately, source_DropboxData is no longer supported due to changes in the Dropbox API.

Version 0.4.4

set_valid_wd informs the user if no valid directory is found.

Version 0.4.3

set_valid_wd sets valid working directory from vector of possible directories.

Version 0.4.2

xlsx package moved to suggests. Most of the package can now be used without xlsx installed or its rJava dependency.

Version 0.4.1

Minor internal change to options for sourcing data.

Minor documentation improvements.

Version 0.4

source_data and source_DropboxData now use fread from the data.table package rather than read.table for faster more robust data loading.

Note: may break code from previous version in some instances. Please check.

Version 0.3.3

Added scan_https for reading a character text file from a secure (https) site into R as a single object.

Version 0.3.2

Added git_stamp function for get git stamp (commit and branch) for a repository. Thanks to Måns Magnusson.

Version 0.3.1

Improved SHA1 Hash messages.

Verion 0.3

source_data now also loads RDATA files. Thanks to Måns Magnusson.

Version 0.2.9

Added source_XlsxData function for downloading and loading Excel files.

Internal code improvements

Internal improvements.

Version 0.2.8

Added cache and clearCache arguments to `source_data. This allows the user to cache the downloaded data frame so that it does not need to be downloaded every time the function is called.


Added ability to pass arguments to source_data, source_DropboxData, and source_GitHubData.

Version 0.2.7

Improvements made to LoadandCite largely suggested by R Journal reviewers. These include:

  • if pkgs = NULL then non-base packages loaded in the current session are cited.

  • can use the style argument to style the citations for the Journal of Statistical Software.

  • automatically includes a citation for the current R version and can check to see if the version of R running matches a specified version.


Minor example changes.


Minor internal changes.

Version 0.2.6

Minor changes to LoadandCite, if file = NULL then the packages are loaded but no BibTeX file is created.

Other internal improvements and bug fixes.

Version 0.2.5

Drawing on devtools version 1.2, this source_data now us finds sha-1 hashes for files and lets the user compare these with the version of the file they have downloaded. This makes it easier to see if you downloaded the same file you thought you had downloaded.

source_GitHubData is now depricated and will not be updated from this point. Please use source_data instead.

Minor default settings change for data commands.

Version 0.2.4

Add source_DropboxData for loading plain-text data from a non-Public Dropbox folder.

Big hat tip to Kay Cichini (http://thebiobucket.blogspot.com/2013/04/download-files-from-dropbox.html)

Version 0.2.3

Add source_data. source_GitHubData turned into a wrapper for source_data.

Version 0.2.2

Change how default repo in LoadandCite is determined/set.

Version 0.2.1

LoadandCite repo option now gets repo information from .Rprofile. Thanks to Karthik Ram.

Version 0.2

  • Add tools to install old R package versions both in a stand alone function (InstallOldPackages) and as part of LoadandCite.

  • the package argument for LoadandCite is deprecated. Use pkgs instead. This is so the syntax matches `install.packages syntax better.

Version 0.1.1

Documentation and external package load fixes.

Version 0.1

Includes the functions LoadandCite for loading and citing R packages as well as source_GitHubData for downloading plain-text data from GitHub.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.5 by Christopher Gandrud, 5 years ago


Report a bug at https://github.com/christophergandrud/repmis/issues

Browse source code at https://github.com/cran/repmis

Authors: Christopher Gandrud [aut, cre]

Documentation:   PDF Manual  

Task views: Web Technologies and Services

GPL (>= 3) license

Imports data.table, digest, httr, plyr, R.cache

Suggests xlsx

Imported by GeneBook, expose, immuneSIM, mastif, pollimetry.

Suggested by Patterns, seer.

See at CRAN