---
title: Reproducible computing: An initial walkthrough
layout: page
---
mkdir BBSRC-git-demo cd BBSRC-git-demo
git init git status
df=read.table('http://data.bris.ac.uk/datasets/swyt56qr4vaj17op9cw3sag7d/LskyetalPLOSONE.csv', header=TRUE,sep=',') head(df)
git status git add somecode.R git status git commit -m"initial add" git status
lm.result=lm(conspiracist_avg~age,data=df) summary(lm.result)
git add somecode.R git commit -m"adding lm"
- log into github.com
- create a new repository (+ sign at top right)
- give it the same name as your directory (BBSRC-git-demo)
- just use the defaults (it should be public) and click "create repository"
- There will be a set of commands in the section titled "…or push an existing repository from the command line"
- copy those and paste them into the terminal inside the directory with your git repository - somethign like:
git remote add origin git@github.com:poldrack/BBSRC-git-demo.git git push -u origin master
Click on the repository link at the top of the page to go to the main repo page. you should see "somecode.R" in the list.
dependencies: pre: - sudo apt-get update && sudo apt-get -y install r-base test: override: - Rscript somecode.R
git add circle.yml git commit -m"initial add" git push origin master
- go to circleci.com and log in using your github account
- click on the "Projects" button (with the + sign) Choose your github account, and then click on the "build project" button for your repo It will then take you to a page showing the status of the build. for an overview, click on the "builds" button which will take you to a list of builds.
after a couple of minutes it should show that the build succeeded
git log
plot(df$age,df$performance)
git add somecode.R git commit -m"adding plot"
git revert
the change in the file should show up immediately in the RStudio editor window
#it's clear from the plot that something is wrong
stopifnot(max(df$age)<60) stopifnot(min(df$age)>20)
git add somecode.R git commit -m"adding assertion test" git push origin master
df=subset(df,age>20&age<60)
git add somecode.R git commit -m"adding outlier removal" git push origin master