#bayes #programming #r #statistics
The replicate function, rep, is also very useful for creating vectors. Here are some examples: > ABC = c("A","B","C") # define a vector for replication > rep( ABC, 2 ) [1] "A" "B" "C" "A" "B" "C" > rep( ABC, times=2 ) [1] "A" "B" "C" "A" "B" "C" > rep( ABC, times=c(4,2,1) ) [1] "A" "A" "A" "A" "B" "B" "C" > rep( ABC, each=2 ) [1] "A" "A" "B" "B" "C" "C" > rep( ABC, each=2, length=10) [1] "A" "A" "B" "B" "C" "C" "A" "A" "B" "B" > rep( ABC, each=2, times=3) [1] "A" "A" "B" "B" "C" "C" "A" "A" "B" "B" "C" "C" "A" "A" "B" "B" "C" "C"
If you want to change selection, open document below and click on "Move attachment"
pdf
owner:
shihabdider - (no access) - Doing Bayesian Data Analysis, p46
Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details