Learn R Programming

RSurvey (version 0.7-9)

SetSortOrder: Set Sort Order

Description

A GUI for specifying the variable used to sort the data set.

Usage

SetSortOrder(col.ids, sort.on = NULL, parent = NULL)

Arguments

col.ids
character; a vector of variable names.
sort.on
integer; the index of the variable used to sort the data set.
parent
tkwin; the GUI parent window.

Value

  • Returns an integer object that specifies the index of the variable used to sort the data set. Attributes for this object include: decreasing, a logical value indicating if the sort order is increasing or decreasing; and na.last, a logical value for controlling the treatment of NAs during sorting. If TRUE, missing values in the data are put last; if FALSE, they are put first; if NA, they are removed.

See Also

order

Examples

Run this code
col.ids <- c("Variable1", "Variable2", "Variable3")
sort.on <- 2
attr(sort.on, "decreasing") <- TRUE
attr(sort.on, "na.last") <- FALSE
SetSortOrder(col.ids, sort.on)

Run the code above in your browser using DataLab