given a data frame x that has columns represententing scores (like posterior probs) for each population in the pops.str (which should be a character vector of population names) which are themselves grouped into reporting units according to rep.units (preferably a factor), this returns a new data frame with all the non-pop columns first and then the pop columns aggregated by summing them up.
1 | gsi_aggScoresByRepUnit(x, pops.str, rep.units)
|
x |
data frame like that obtained by reading in "pop_pofz_full_em_mle.txt" or a similar output file from gsi_sim (with rownames=1) |
pops.str |
names of the populations that are the column names of x |
rep.units |
factor vector of same length as pops.str which given the reporting units of the populations in pops.str |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.