sort.data.frame: Implement the 'sort' and 'order' methods for 'data.frame' and...

Description Usage Arguments Value See Also Examples

View source: R/misc.utilities.R

Description

These function return a data frame sorted in lexcographic order or a permutation that will rearrange it into lexicographic order: first by the first column, ties broken by the second, remaining ties by the third, etc..

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
order(..., na.last = TRUE, decreasing = FALSE)

## Default S3 method:
order(..., na.last = TRUE, decreasing = FALSE)

## S3 method for class 'data.frame'
order(..., na.last = TRUE, decreasing = FALSE)

## S3 method for class 'matrix'
order(..., na.last = TRUE, decreasing = FALSE)

## S3 method for class 'data.frame'
sort(x, decreasing = FALSE, ...)

Arguments

...

Ignored for sort. For order, first argument is the data frame to be ordered. (This is needed for compatibility with order.)

na.last

See order documentation.

decreasing

Whether to sort in decreasing order.

x

A data.frame to sort.

Value

For sort, a data frame, sorted lexicographically. For order, a permutation I (of a vector 1:nrow(x)) such that x[I,,drop=FALSE] equals x ordered lexicographically.

See Also

data.frame, sort, order, matrix

Examples

1
2
3
4
5
6
7
8
9

statnet.common documentation built on Aug. 16, 2017, 5:04 p.m.