Learn R Programming

rpf (version 1.0.14)

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

Description

Completely order all rows in a data.frame.

Usage

orderCompletely(observed)

Value

the sorted order of the rows

Arguments

observed

a data.frame holding ordered factors in every column

Examples

Run this code
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),]

Run the code above in your browser using DataLab