vasishth / bayescogsci

Draft of book entitled An Introduction to Bayesian Data Analysis for Cognitive Science by Nicenboim, Schad, Vasishth
100 stars 27 forks source link

unnecessary c() in first code chunk of section 5.1 #46

Closed inigourrestarazu closed 1 year ago

inigourrestarazu commented 1 year ago

The first code chunk in section 5.1 goes as follows:

N_subj <- 20
N_obs_subj <- 50
N <- N_subj * N_obs_subj
df <- tibble(row = 1:N,
             subj = rep(c(1:N_subj), each = N_obs_subj))
df

I think the c() in the rep function can be dropped and it will work just the same:

df <- tibble(row = 1:N,
             subj = rep(1:N_subj, each = N_obs_subj))
bnicenboim commented 1 year ago

yes, thank you! it'll be updated next time we compile the book