-
Notifications
You must be signed in to change notification settings - Fork 0
/
hoist_attempt.R
37 lines (30 loc) · 985 Bytes
/
hoist_attempt.R
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
28
29
30
31
32
33
34
35
36
37
library(tidyverse)
infiles <- dir(path="e2_csvs", pattern = "*.csv$", full.names=TRUE)
n_infiles = length(infiles)
subjects = list()
for (i in seq_along(infiles)){
subject <- read_csv(infiles[i], col_types = cols()) %>% filter(bg_type!="practice")
subjects[[i]] = list(
pid=subject$participant,
trl=subject$trial_number,
cnd=subject$resource_distribution %>%
str_replace(pattern="patchy", replacement="clumped") %>%
str_replace(pattern="dispersed", replacement="random"),
smp=subject$sample,
frt=subject$fruits
)
}
subjs <- tibble(subj=subjects)
subjs %>% unnest_wider(subj)
users <- tibble(user=gh_users)
users %>% unnest_wider(user)
users %>% hoist(user,
fooooollowers = "followers",
login = "login",
url = "html_url"
)
subjs %>% hoist(subj,
pidtastic="pid",
trltastic="trl",
cntasticd="cnd"
) %>% View()