Chapter 10 Publishing

Git and github allows collaboration and version control on large software projects, but it also provides a convenient way of publishing data projects to the web. This is the way we will use to produce our final projects for this module.

10.1 Sharing your Rmd files via Github pages

  1. Create a new github repositry (a “repo”)
  • click “initilise with”
  1. “clone” to your computer
  • Either use git to manage the files in the repo, (in which case you need to add, commit and push to the remote repositry)
  • OR upload the files to the repo via the web interface.

If you are making multiple changes to your files, using git on your computer is easier (see the class on git and github)

  1. Save your analysis in a file index.Rmd

  2. Add an .html file called index.html. This file can be created by clicking ‘knit’ in RStudio from your .Rmd file (see the class on Rmarkdown)

  • selecting ‘knit to HTML’ if you haven’t specified this in the header
  1. Upload or “Push” your files, most importantly the index.html file to a github repo, probably viewable at something like:
  • NOTE: To make the repository an archive of your project you can and should add all the other other files and folders, including the .Rmd file which you used to make the index.html file
  1. Visit this link and, via the browser,

10.2 Other sharing options

The Open Science Framework a platform which provides storage and sharing for all materials across the whole lifespan of a project. Incredibly useful for sharing, but doesn’t look as nice as github pages, so we’re not using it on psy6422.

Jupyter notebooks. Another way of mixing description, code and outputs. More common for python code.

10.3 Checklist

  • Publish website using github pages
  • Understand that index.html is the default page for a website
  • Use projects in RStudio

10.4 Resources