Skip to content

How to spend hours of your life on StackOverflow: Using Git and targets for scientific coding. The aim is to introduce hands-on coding on how to use Git for data management and joint coding, as well as the targets R-package for reproducible data pipelines.

Notifications You must be signed in to change notification settings

thosdavidson/git-and-targets-introduction

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Git and Targets


👥 Robert Ladwig
📧 Questions?


Aim of this introduction

The aim is to introduce hands-on coding on how to use Git for data management and joint coding, as well as the targets R-package for reproducible data pipelines.

Fair warning: This short introduction is superficial. It will introduce you to the pure basics. But often these are enough to get started.

What is Git?

Git is a software which is used to keep track of files that are being simultaneously edited by multiple users (and allows you to publish them all). GitHub (owned by Microsoft), on the other hand, is a Git server. It's a remote location where you can host code that is stored in Git.

What is Targets?

Targets is an R-package, which allows you to build Make-like pipelines (so you can create reproducible workflows) for statistics and data science. The package skips costly runtime for tasks that are already up to date, orchestrates the necessary computation with implicit parallel computing, and abstracts files as R objects (more efficiency).

Targets has a minimum structure of

├── _targets.R
├── R/
│   ├── functions.R

Before we get started

  1. Create a GitHub account
  2. Install Git for Windows
  3. Install the R-package targets
  4. Open a terminal and set up your Git information:
git config --global user.name "Mona Lisa"
git config --global user.email "YOUR_EMAIL"

Important Git vocabulary

  • repositories
  • branches
  • fork
  • clone
  • push and pull
  • pull request

Important Git commands

git clone
git status
git pull 
git add .
git commit -m "MESSAGE"
git push

Important Targets commands

tar_make()
tar_read()

Why use Git and Targets?

You can work collaboratively on your code (which will make it better eventually), track changes and easily publish all data (for reproducibility and to have a backup). Further, you can run the whole workflow again later without needing to remember all details.

Next? Do the GitHub and Targets tutorials

About

How to spend hours of your life on StackOverflow: Using Git and targets for scientific coding. The aim is to introduce hands-on coding on how to use Git for data management and joint coding, as well as the targets R-package for reproducible data pipelines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%