order_points: Re-order a data frame for plotting points in ggplot

View source: R/order_points.R

order_pointsR Documentation

Re-order a data frame for plotting points in ggplot

Description

Re-order a data frame to control the plotting order of points in ggplot. This is designed to control over-plotting of points by sorting the data frame based on input arguments. It is used in plots by symbol and color, where overplotting may affect readability.

Usage

order_points(x, method)

Arguments

x

data frame containing data to re-order

method

character string, specifying how to order the rows. Currently accepted values are "random", which randomizes the order, and "input", which returns the input data frame as-is.

Value

a data frame with same contents as x, with rows re-ordered according to method.


mjdufort/miscHelpers documentation built on Feb. 4, 2024, 7:44 p.m.