sort.VIgraph: Sort VI.ggplot points list

View source: R/VIMethod3_TH.R

sort.VIgraphR Documentation

Sort VI.ggplot points list

Description

Allows the list of data points listed by VI.ggplot to be sorted by x or y values, ascending or descending. Currently only implemented for geom_points. This function is experimental and has not been extensively tested.

Usage

## S3 method for class 'VIgraph'
sort(x, decreasing = FALSE, by = "x", ...)

Arguments

x

object returned by VI.ggplot

decreasing

logical: should the sort be decreasing

by

value on which to sort, "x" or "y"

...

further arguments passed to base::sort

Value

Returns a new object of the same type as that returned by VI.ggplot, but with data re-ordered.

Author(s)

Debra Warren and Paul Murrell

Examples

if (require(ggplot2)) {
    sort(VI(qplot(x=1:5, y=c(2,5,1,4,3))), decreasing=TRUE, by="y")
}

BrailleR documentation built on July 26, 2023, 5:46 p.m.