topBottomDistribute | R Documentation |
Produce offsets to generate smile-like or frown-like distributions of points. That is sorting the points so that the most extreme values alternate between the left and right e.g. (max,3rd max,...,4th max, 2nd max). The function returns either a proportion between 0 and 1 (useful for plotting) or an order
topBottomDistribute(x, frowney = FALSE, prop = TRUE)
x |
the elements to be sorted |
frowney |
if TRUE then sort minimums to the outside, otherwise sort maximums to the outside |
prop |
if FALSE then return an ordering of the data with extremes on the outside. If TRUE then return a sequence between 0 and 1 sorted by the ordering |
a vector of the same length as x with values ranging between 0 and 1 if prop is TRUE or an ordering of 1 to length(x)
topBottomDistribute(1:10)
topBottomDistribute(1:10,TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.