Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

update the stata and perl installation guide #24

Open
wants to merge 4 commits into
base: tilburg-update
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified CONDUCT.md
100644 → 100755
Empty file.
Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified DESCRIPTION
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified docs/acknowledgement.md
100644 → 100755
Empty file.
Empty file modified docs/contact.md
100644 → 100755
Empty file.
Empty file modified docs/examples/dropbox.md
100644 → 100755
Empty file.
Empty file modified docs/index.md
100644 → 100755
Empty file.
Binary file added docs/setup/clonedesk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/setup/commandLine.md
100644 → 100755
Empty file.
Binary file added docs/setup/git-cycle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/setup/git.png
Binary file not shown.
131 changes: 59 additions & 72 deletions docs/setup/gitInstall.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -83,101 +83,88 @@ Ensure that you have a version greater than `2.15.0` installed.

## A short instruction for Git

1. Configure
### Before we start

In order to use Github locally, you can configure your user name and email of your Github account in local PC. In your terminal, you can type the following command to configure.
- Configure

```bash
# set the author name for your commits
git config --global user.name "[name]"

# set the author email for your commits
git config --global user.email "[email address]"

# enables colorization for command line output
git config --global color.ui auto
```
In order to use Github locally, you can configure your user name and email of your Github account in local PC. In your terminal, you can type the following command to configure.

```bash
# set the author name for your commits
git config --global user.name "[name]"

# set the author email for your commits
git config --global user.email "[email address]"
```

When you finish the configuration, you can type `git config --list` to check the user information.

2. Create repositories
### A typical workflow

To start, you need to create a new repository once.You can create a local repository and then push to Github, or clone an existing repository from Github to your local PC.
![git-cycle](git-cycle.png)

1. Create a repository on Github

To start, you need to create a repository once. You can create a repository on Github and then clone to your local PC. Or you can fork other's repository and then clone to your local PC.

`New repository` or `fork other's repository` -> copy `[email protected]:username/newrepository.git` -> go to the folder that you want to put the repository locally `cd localfolder` ->

```bash
# create a git repository from a locally existing directory
git init

# clone an existing repository from Github to local PC
git clone "[url]"
git clone [email protected]:username/newrepository.git
```

3. Branches

Branches are key tools for version control. Everyone can make changes to his own working branch, and merge their changes to a master branch. You can use `git status` to check your working branch.

``` bash
# create a branch [branch-name]
git branch [branch-name]

# switch to s specific branch [branch-name]
git checkout [branch-name]

# merge a specific branch [branch] to the working branch
git merge [branch]

# delete a specific branch [branch-name]
git branch -d [branch-name]
```

4. Make changes
2. Commit local change

Everytime when you make changes to your project, you can use the following command to browse and inspect changes.
Each time when you change you programs, you can record snapshots permanently in version history, so that you can check every version in the future in case. **Commit Frequently!**

``` bash
# list all version histories of current branch
git log

# present content differences between two branches [first-branch] vs [second-branch]
git diff [first-branch]...[second-branch]

# snapshot the file in preparation for versioning
git add [file]

```bash
# record file snapshots permanently in version history
git commit -m "[descriptive message]"
```

5. Sync
- You can use `git add filename` to store your changed file to the stage first, so that git can save every change for further management.
- You can use `git status` to check the status of all your changes before `git commit`.

Everyone can sync their local changes with the remote repository on Github(usually the online master branch). You can also get changes to your local repository from the remote repository.
3. Push to Github

``` bash
# download all history from the remote tracking branches
git fetch

# combine remote tracking branch into current local branch
git merge

Since you are cooperating with coauthors, you can share your changes by uploading all local branch commits to GitHub. **Push Frequently!** But less frequent than `Commit`.

```bash
# upload all local branch commits to GitHub
git push

# update your local working branch with all new commits from the remote branch on GitHub
# `git pull` is a combination of `git fetch` and `git merge`
git pull
```

![Git](git.png)
### If you prefer graphical UI

6. Reset
The typicla workflow can be realized by graphical *Github Desktop*. [Download GIthub Desktop](https://desktop.github.com).

You may want to reset your changes and replace them with historical version.
- Log in your Github account

- `file`->`clone repository`->choose `repository` and `local path`, then `clone`

![](clonedesk.png)

- `commit` with a description message on the down left, then `push` on the up right.

![](pushdesk.png)

``` bash
# undo all commits after [commit], preserving changes locally
git reset [commit]

# drop all history and changes back to the specified commit
git reset --hard [commit]
```



### Branches for Cooperation

Branches are key tools for version control. Every cooperator can make changes to his own working branch, and merge their changes to a master branch. You can use `git status` to check your working branch.

``` bash
# create a branch [branch-name]
git branch [branch-name]

# switch to s specific branch [branch-name]
git checkout [branch-name]

# merge a specific branch [branch] to the working branch
git merge [branch]

# delete a specific branch [branch-name]
git branch -d [branch-name]
```
Empty file modified docs/setup/index.md
100644 → 100755
Empty file.
61 changes: 61 additions & 0 deletions docs/setup/lyx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Installing Lyx

Lyx is an open source document processor based on the LaTeX. [Download Lyx](https://www.lyx.org/Download).

## Making Lyx Available on the Command Prompt

You have just installed Lyx and may need to access Lyx from the command line.

### Windows users
For you to be able to use Lyx from the command prompt, follow the steps below.

!!! danger "Making Lyx available via the PATH settings on Windows"
We need to update our PATH settings; these settings are a set of directories that Windows uses to "look up" software to startup.

- Right-click on Computer.
- Go to "Properties" and select the tab "Advanced System settings".
- Choose "Environment Variables" and select `Path` from the list of system variables.
- Choose `Edit`.
- Environment variable name: LYX_BIN
- **Windows 7 and 8 machines:**
If you chose the default installation directory, copy and paste the following string without spaces at the start or end:

`c:\Program Files (x86)\Lyx`

- **Windows 10 machines:**
- Click `New` and paste the following string:

`c:\Program Files (x86)\Lyx`

- Click on `OK` as often as needed.

### Mac users

For you to be able to use Lyx from the command line, you have to add Lyx to your environmental variables. A tutorial follows.

!!! danger "Making Lyx available via the PATH settings on Mac"

- open Terminal
- type `vi ~/.bash_profile`
- add Lyx to the environmental varibles
- type `i` to input mode of vim
- add `export LYX_BIN=/Applications/LyX.app/Contents/MacOS/lyx`.
- press `esc` and type `:w` to save the change
- close the ternimal and reopen one terminal. Then type `source ~/.bash_profile` to bring the new .bash_profile into effect.
- type `$LYX_BIN` to check availability. Remember to type the `$` before `LYX_BIN`.


<!--- Linux users not available yet
-->


## Verifying that the installation was successful

To verify that Lyx has been correctly installed and configured via your PATH settings,
open a **new** terminal interface and enter:

```bash
$LYX_BIN
```

followed by hitting the `Return` key.
Empty file modified docs/setup/make-intro.md
100644 → 100755
Empty file.
Empty file modified docs/setup/make.md
100644 → 100755
Empty file.
Empty file modified docs/setup/matlab.md
100644 → 100755
Empty file.
Empty file modified docs/setup/pandoc.md
100644 → 100755
Empty file.
Empty file modified docs/setup/path-setting.md
100644 → 100755
Empty file.
45 changes: 45 additions & 0 deletions docs/setup/perl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Installing Perl

Perl is an open programming language frequently used by engineers. We use Perl for text processing, such as processing tables generated by other statistical softwares.



## Making Stata Available on the Command Prompt

Perl is already installed on Mac and Linux OS. [Download Perl](https://www.perl.org/get.html) for Windows OS.

### Windows users

For you to be able to use Perl from the command prompt, follow the steps below.

!!! danger "Making Perl available via the PATH settings on Windows"
We need to update our PATH settings; these settings are a set of directories that Windows uses to "look up" software to startup.

- Right-click on Computer.
- Go to "Properties" and select the tab "Advanced System settings".
- Choose "Environment Variables" and select `Path` from the list of system variables.
- Choose `Edit`.
- **Windows 7 and 8 machines:**
If you chose the default installation directory, copy and paste the following string without spaces at the start or end:

`;c:\Program Files (x86)\Perl`

- **Windows 10 machines:**
- Click `New` and paste the following string:

`c:\Program Files (x86)\Perl`

- Click on `OK` as often as needed.

###

## Verifying that the installation was successful

To verify that Perl has been correctly installed and configured via your PATH settings,
open a **new** terminal interface and enter:

```bash
perl -v
```

followed by hitting the `Return` key. Perl is successfully installed if you can see the version of Perl in the command line.
Binary file added docs/setup/pushdesk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/setup/python-more.md
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions docs/setup/python.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ You should see the following information returned:
### Windows users:

```bash
Python 3.6.5 :: Anaconda, Inc.
Python 3.x.x :: Anaconda, Inc.
```

### Mac & Linux/Ubuntu users:

```bash
Python 3.6.2 :: Anaconda custom (64-bit)
Python 3.x.x :: Anaconda custom (64-bit)
```

!!! tip "Python 2 versus Python 3"
Expand All @@ -50,5 +50,5 @@ Python 3.6.2 :: Anaconda custom (64-bit)
you might have seen `Python 2.x.x` above. In that case try typing

```python3 --version```

instead. Now you should see a message like the one above and are good to go for the course.
Empty file modified docs/setup/r.md
100644 → 100755
Empty file.
Empty file modified docs/setup/r.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/setup/snakemake.md
100644 → 100755
Empty file.
29 changes: 14 additions & 15 deletions docs/setup/stata.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ For you to be able to use Stata from the command prompt, follow the steps below.
- Go to "Properties" and select the tab "Advanced System settings".
- Choose "Environment Variables" and select `Path` from the list of system variables.
- Choose `Edit`.
- Environment variable name: STATA_BIN
- **Windows 7 and 8 machines:**
If you chose the default installation directory, copy and paste the following string without spaces at the start or end:

`;c:\Program Files (x86)\Stata15`
`c:\Program Files (x86)\Stata15`

Using a different Stata version? Change the version number then in the path above.

Expand All @@ -39,20 +40,18 @@ For you to be able to use Stata from the command prompt, follow the steps below.

### Mac users

For you to be able to use Stata from the command line, you have to add Stata to your bash file. A tutorial follows.

!!! danger "Making Stata available via the PATH settings on Mac"
For you to be able to use Stata from the command line, you have to add Stata to your environmental variables. A tutorial follows.

```
Step 1: add Stata to bash file
- Open `Terminal`.
- Type `echo "export PATH=$PATH: Your Stata Path" >> ~/.bash_profile`. For example,
`export PATH=$PATH: /Applications/Stata/StataMP.app/Contents/MacOS/ >> ~/.bash_profile`

Step 2: Evaluate bash changes
- Type `echo $PATH` to check whether Stata is added to your path.
```
!!! danger "Making Stata available via the PATH settings on Mac"

- open Terminal
- type `vi ~/.bash_profile`
- add Stata to the environmental varibles
- type `i` to input mode of vim
- add `export STATA_BIN=/Applications/Stata/StataMP.app/Contents/MacOS/stataMP`. You may need to replace stataMP to stataSE or so, which depends on which Stata you install on Mac.
- press `esc` and type `:w` to save the change
- close the ternimal and reopen one terminal. Then type `source ~/.bash_profile` to bring the new .bash_profile into effect.
- type `$STATA_BIN -v` to check availability. Remember to type the `$` before `STATA_BIN`.


<!--- Linux users not available yet
Expand All @@ -65,7 +64,7 @@ To verify that Stata has been correctly installed and configured via your PATH s
open a **new** terminal interface and enter:

```bash
StataSE-64.exe
$STATA_BIN -v
```

followed by hitting the `Return` key. Stata will now start.
followed by hitting the `Return` key. You can check the Stata version.
Empty file modified docs/setup/teamviewer.md
100644 → 100755
Empty file.
Empty file modified docs/setup/teamviewer.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/setup/textEditor.md
100644 → 100755
Empty file.
Empty file modified docs/setup/webscraping_drivers.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/automation.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/automation_workflow.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/checklist.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/checklist.xlsx
100644 → 100755
Empty file.
Empty file modified docs/workflow/data.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/directories.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/directories_alt.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/doc.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/doc_data.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/housekeeping.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/index.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/make_flowchart.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/workflow/portability.md
100644 → 100755
Empty file.
Empty file modified docs/workflow/structure_phd_2013.html
100644 → 100755
Empty file.
Empty file modified docs/workflow/structure_spotify_2018.html
100644 → 100755
Empty file.
Empty file modified docs/workflow/versioning.md
100644 → 100755
Empty file.
Loading