sortVectors | R Documentation |
Sort two frequency vectors by the values in the first.
sortVectors(Z,R)
Z |
Population vector |
R |
Vector for the representatives |
This function takes two vectors of the same length, denoting for example the proportion of different groups in the population and among representatives. The function sorts both vectors by the first one. Put differently, the first vector will be sorted by decreasing value. The second vector will be sorted so that each position of the vector refers to the same group. This is a simple application of the order
function in R.
A list with two vectors, Z and R, sorted by Z
Didier Ruedin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.