um-dang / loops-apply-r

Looping in R: for loops & the apply family

Home Page:http://um-dang.github.io/loops-apply-r/for_loops_and_apply_fam_master.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

loops-apply-r

IMDb_Economist_tv_ratings.csv courtesy of tidytuesday

View the rendered RMarkdown as HTML here.

Overview of lesson

1. R basics - vectors, matrices, lists, logicals

2. Iterating through vectors and matrices with for loops

3. Vectorized vs. sapply vs. for loop

Inspired by this post

4. Looping over a vector or list: sapply() or lapply()

5. Looping over a matrix/data.frame: apply()

6. Faster looping with future.apply

Here's a Data Camp tutorial to learn more about paralell programming in R -- specifically future and future.apply()