-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.r
More file actions
28 lines (22 loc) · 668 Bytes
/
init.r
File metadata and controls
28 lines (22 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
##
## load Mosuo data
##
library(tidyverse)
source("init plots.r")
# where stuff is
data.dir = "data"
plots.dir = "plots"
models.dir = "models"
results.dir = "results"
# create folders if needed (except data folder: if that's missing, you can't do much more here)
if (!dir.exists(plots.dir)) # plots
dir.create(plots.dir)
if (!dir.exists(models.dir)) # models
dir.create(models.dir)
if (!dir.exists(results.dir)) # results
dir.create(results.dir)
load(file.path(data.dir, "mosuo.rdata"))
# split people into kids and adults
adult.age = 15
mosuo.children = subset(mosuo.people, Age < adult.age)
mosuo.adults = subset(mosuo.people, Age >= adult.age)