This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###################### | |
| # GAPMINDER Exercise | |
| ###################### | |
| install.packages("gapminder") | |
| library(gapminder) | |
| # read in data | |
| data(gapminder) | |
| head(gapminder) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########### | |
| ## COIN FLIP EXERCISE | |
| ########### | |
| # simple coin flip | |
| rbinom(n = 1, size = 1, prob = 0.5) | |
| # flip 100 times | |
| rbinom(100, 1, 0.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##### | |
| # CODE SNIPPETS FROM IN-CLASS EXERCISES | |
| # Empirical Legal Studies (Fall 2025) | |
| ##### | |
| ########## | |
| ## reading in datasets | |
| # when reading in CSV files you need to assign to an object | |
| # filename is the full path on your computer |