<commit_before>
## Reproducible workflow walkthrough for BBSRC Meeting

This walkthrough assumes that you have [git](https://git-scm.com/downloads) and [RStudio Desktop](https://www.rstudio.com/products/rstudio/download/) installed on your computer and that you can access a terminal window (using Terminal on the Mac, or Git Bash on Windows).  It also assumes that you have created an account for yourself on [GitHub](http://github.com).

### 1. make a new directory and cd into it
```
mkdir BBSRC-git-demo
cd BBSRC-git-demo
```

### 2. create a new (local) git repository
```
git init
```
You can now check the status of your local repository (it should be empty)
```
git status
```

### 3. Start up RStudio, and create a new R script called somecode.R containing the following lines (which  will load the data from the [Lewandowsky et al. study](http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0075637):
```
# R code
df=read.table('http://data.bris.ac.uk/datasets/swyt56qr4vaj17op9cw3sag7d/LskyetalPLOSONE.csv',
              header=TRUE,sep=',')
head(df)
```
Note: code to be added to the R script is marked with "# R code".  Any cells not marked this way are meant to be typed into the terminal window.

### 4. After you save the file, run the R script using the "source" button in Rstudio

### 5. (Hopefully!) this worked, so let's check our file into the repo
```git status
git add somecode.R
git status
git commit -m"initial add"
git status
```

You may experience an error when you type the command to commit the change.  In this case, you need to enter the following commands to set your identity with git:

```
git config --global user.email "<EMAIL>"
git config --global user.name "<NAME>"
```
replacing the placeholders with your actual email address and name.

### Now let's run a linear regression model to see if conspiracist thinking is related to age

### 6. add the following code to the end of somecode.R and source the file using the Source button in RStudio:
```
# R code
lm.result=lm(conspiracist_avg~age,data=df)
summary(lm.result)
```

### 7. This should also complete successfully.  Let's go ahead and check in again
```
git add somecode.R<commit_msg>Clean u more verbose<commit_after>
## Reproducible workflow walkthrough for BBSRC Meeting

This walkthrough assumes that you have [git](https://git-scm.com/downloads) and [RStudio Desktop](https://www.rstudio.com/products/rstudio/download/) installed on your computer and that you can access a terminal window (using Terminal on the Mac, or Git Bash on Windows).  It also assumes that you have created an account for yourself on [GitHub](http://github.com).

### 1. make a new directory and cd into it
```
mkdir BBSRC-git-demo
cd BBSRC-git-demo
```

### 2. create a new (local) git repository
```
git init
```
You can now check the status of your local repository (it should be empty)
```
git status
```

### 3. Create a sample source code file.
Start up RStudio. Create a new R script called somecode.R containing the following lines (which  will load the data from the [Lewandowsky et al. study](http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0075637):
```
# R code
df=read.table('http://data.bris.ac.uk/datasets/swyt56qr4vaj17op9cw3sag7d/LskyetalPLOSONE.csv',
              header=TRUE,sep=',')
head(df)
```
Note: code to be added to the R script is marked with "# R code".  Any cells not marked this way are meant to be typed into the terminal window.

### 4. After you save the file, run the R script using the "source" button in Rstudio
Remember to save the file inside the `BBSRC-git-demo` directory you created in step 1.

### 5. (Hopefully!) this worked, so let's check our file into the repo
```git status
git add somecode.R
git status
git commit -m"initial add"
git status
```

You may experience an error when you type the command to commit the change.  In this case, you need to enter the following commands to set your identity with git:

```
git config --global user.email "<EMAIL>"
git config --global user.name "<NAME>"
```
replacing the placeholders with your actual email address and name.

### Now let's run a linear regression model to see if conspiracist thinking is related to age

### 6. add the following code to the end of somecode.R and source the file using the Source button in RStudio:
```
# R code
lm.result=lm(conspiracist_avg~age,data=df)
summary(lm.result)
```

### 7. This should also complete successfully.  Let's go ahead and check in again
```
git add somecode.R
{'fraction_non_alphanumeric': 0.10150709219858156, 'fraction_numerical': 0.012632978723404254, 'mean_word_length': 4.18735632183908, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2780943', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1314, 'n_words': 617}