topBottomDistribute: Produce offsets such that points are sorted with most extreme...

Description Usage Arguments Value Examples

View source: R/violinPoint.R

Description

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

Usage

1
topBottomDistribute(x, frowney = FALSE, prop = TRUE)

Arguments

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

Value

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)

Examples

1
2

vipor documentation built on May 29, 2017, 9:38 a.m.