sort.VIgraph | R Documentation |
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.
## S3 method for class 'VIgraph'
sort(x, decreasing = FALSE, by = "x", ...)
x |
object returned by |
decreasing |
logical: should the sort be decreasing |
by |
value on which to sort, "x" or "y" |
... |
further arguments passed to |
Returns a new object of the same type as that returned by VI.ggplot, but with data re-ordered.
Debra Warren and Paul Murrell
if (require(ggplot2)) {
sort(VI(qplot(x=1:5, y=c(2,5,1,4,3))), decreasing=TRUE, by="y")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.