CRAN_Status_Badge Travis-CI Build Status AppVeyor Build Status Coverage Status


Generates a project and repo for easy initialization of a workshop.

GitHub Token

This is dependent on having a GitHub Personal Access Token (PAT).

First, go to GitHub user settings. Then click on Developer Settings.

On the following page click Personal Access Token.

Then click Generate new token.

Finally, select the Repo option.

The way some of the packages this package depends on are written, require that this code be saved in an environment variable. The best way to do this is to have a file named .Renviron in your home directory which can be located with Sys.getenv('HOME'). The file should look like this.


Generating a Project

To create a project and turn it into a GitHub repo use the createRepo function.

If you have a list of data files stored somewhere that you want the user to download, build a data.frame listing at least the local name to be used for the data, the URL where the data are stored and the mode to write the data such as ‘w’ or ‘wb’. If you don’t provide one, the default data stored in my repo will be used. You should also specify a set of packages for the users to install.

data(datafiles, package='RepoGenerator')
datafiles[, c('Local', 'Remote', 'Mode')]
#>                     Local
#> 1       DiamondColors.csv
#> 2             diamonds.db
#> 3       ExcelExample.xlsx
#> 4      FavoriteSpots.json
#> 5         flightPaths.csv
#> 6            reaction.txt
#> 7            ribalta.html
#> 8      SocialComments.xml
#> 9         TomatoFirst.csv
#> 10            visited.csv
#> 11     manhattan_Test.rds
#> 12    manhattan_Train.rds
#> 13 manhattan_Validate.rds
#> 14    manhattan_Train.csv
#>                                                       Remote Mode
#> 1    w
#> 2   wb
#> 3   wb
#> 4    w
#> 5    w
#> 6    w
#> 7    w
#> 8    w
#> 9    w
#> 10    w
#> 11   wb
#> 12   wb
#> 13   wb
#> 14    w
packages <- c('caret', 'coefplot','DBI', 'dbplyr', 'doParallel', 'dygraphs', 
              'foreach', 'ggthemes', 'glmnet', 'jsonlite', 'leaflet', 'odbc', 
              'recipes', 'rmarkdown', 'rprojroot', 'RSQLite', 'rvest', 
              'tidyverse', 'threejs', 'usethis', 'UsingR', 'xgboost', 'XML', 
    # the name to use for the repo and project
    # the location on disc to build the project
    # the list of data files for the user to download
    # vector of packages the user should install
    # the GitHub username to create the repo for
    # the new repo's README has the name of who is organizing the class
    organizer='Lander Analytics',
    # the name of the environment variable storing the GitHub PAT


The earlier code created this repo on GitHub. You can point your attendees to the repo you created for easy instructions on getting ready for the workshop!