cranvas (version 0.8.5)

record_selector: Select a subset of data through a GUI to be brushed

Description

We use a GUI created by qtbase to subset the data based on a given categorical variable. Specifically, we choose certain values of the variable (using the mouse or keyboard) and all the observations which have the same values on this variable will be brushed. This selector can link to any plots based on a mutaframe created by qdata.

Usage

record_selector(vars, data)

Arguments

vars
a character string or an integer as a column index, or a variable name (without quotes): the variable to be displayed in the data selector (if not specified, the first non-numeric variable will be used; if all columns are numeric, the first column will be used)
data
a mutaframe created by qdata

Value

NULL (a GUI will pop up)

Details

The GUI supports multiple selections when we hold the Shift or Ctrl key. If the character string in the text input box matches with multiple items in the list, all of them will be selected.

When we select items in the list, usually a plot based on the same data will get brushed accordingly. On the other hand, when we click on a plot, the corresponding items in the list will be selected as well.

See Also

qdata

Examples

Run this code
library(cranvas)

## old iris as the toy example
qiris <- qdata(iris)
qparallel(~., data = qiris)
record_selector(Species, data = qiris)

## NRC rankings
qnrc <- qdata(nrcstat)
qparallel(10:13, data = qnrc, main = "Overview of Rankings", horizontal = FALSE)
record_selector(Institution, data = qnrc)
qparallel(14:19, data = qnrc, main = "Research, Student Support, Diversity")
qparallel(20:26, data = qnrc, main = "Publication, Award, Time to Degree")

cranvas_off()

Run the code above in your browser using DataLab