BrailleR (version 0.29.1)

sort.VIgraph: 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 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.

Examples

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

Run the code above in your browser using DataLab