orderCompletely: Order a data.frame by missingness and all columns

Description Usage Arguments Value Examples

View source: R/dataframe.R

Description

Completely order all rows in a data.frame.

Usage

1
orderCompletely(observed)

Arguments

observed

a data.frame holding ordered factors in every column

Value

the sorted order of the rows

Examples

1
2
3
4
df <- as.data.frame(matrix(c(sample.int(2, 30, replace=TRUE)), 10, 3))
mask <- matrix(c(sample.int(3, 30, replace=TRUE)), 10, 3) == 1
df[mask] <- NA
df[orderCompletely(df),]

Example output

Loading required package: parallel
sh: 1: cannot create /dev/null: Permission denied
sh: 1: wc: Permission denied
   V1 V2 V3
9  NA NA  2
8  NA  2 NA
3  NA  1  1
4  NA  2  1
1   1 NA NA
10  1 NA  1
5   1 NA  2
6   2  2 NA
7   2  1  2
2   2  2  2

rpf documentation built on May 8, 2018, 1:05 a.m.