albertbuchard / introduction_a_r

Introductory course to R and Data analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

R Introduction

Introductory course to R and Data analysis

Main file is scripts/markdown/introduction.pdf

How to keep your code clean

Coding convention

  • Pick a naming convention and stick to it

    • snake_case = "this is a nice too"
    • camelCase = "this is ok too"
  • Comment your code

  • Look at the google style book to make sure your code is easilly readable by anyone

    • Google style guide
    • they advice to use only "<-" and not "=" but I personally think it is pointless

Storage

Keep a README.md file at the root of your folder explaining where everything is, helping someone that knows nothing about your data to navigate your work. Keeping your work in the cloud, through services like dropbox, icloud, or google drive. The best would be github but it is not easy in the beginning.

Folders

Keep your folder clean, with clear names in minuscules separated by "_" :

  • data

    • raw
    • preprocessed
    • analysis
      • analysis_one ...
  • scripts

    • preprocessing: scripts that transforms the raw data in processed data
    • analysis: scripts that use preprocessed data and performs analysis on it
    • markdown: your markdown files
    • r_files: other R files, like utility functions
  • media: here should go any ressources, presentations, images you produced or needed etc...

    • presentations
    • graphics
    • text
    • notes
  • backups: you might need a backup folder when in doubt

    • data
    • script
    • media

Cheat sheet

Install R

Get RStudio

SWIRL

For a good interactive tutorial directly built in R try SWIRL

To start a swirl session enter in the console : +++

install.packages("swirl")
library("swirl")
swirl()

Style Guides - Good to read before programming

Books

Data Exploration

Data analysis pipeline

Ressources

Import

Tidy

Transformation

Visualization

Statistics

Modeling

Videos

Packages

  • Zelig
  • Caret

Interpolation and Fitting

Diffusion model

Markdown

Intro

Examples

R packages

Creating it

Documentation/Comments

Import/Depend

Putting it on github

Putting it on cran

Install a package from source file

Object Oriented programming

Choosing between object type

Multicore

Debugging

messy google doc


Work in progress - help welcome !


Bavelier Lab 2016

(MIT License)

About

Introductory course to R and Data analysis


Languages

Language:HTML 99.6%Language:R 0.4%