Learn R Programming

relimp (version 0.8-2)

pickFrom: Pick Subsets from a Vector

Description

Provides a Tk dialog for interactive selection of one or more subsets from a vector. Requires the tcltk package.

Usage

pickFrom(vec, nsets = 1, return.indices = FALSE, setlabels = NULL,
  title = "Subset picker",
  items.label = "Pick from:")

Arguments

vec
a vector
nsets
an integer, the number of subsets to be selected
return.indices
logical, whether indices (TRUE) or vector contents (FALSE) are to be returned
setlabels
a character vector of labels for the subsets
title
title of the Tk dialog window
items.label
a label for the set of items to be selected from

Value

  • A list, with nsets components. Each component is a selected sub-vector, or a numeric vector of indices for a selected sub-vector (if return.indices is TRUE); the component names are as specified in setlabels, or interactively.

Examples

Run this code
## This cannot be run by example() but should be OK when pasted
## into an interactive R session
pickFrom(c("apple", "banana", "plum", "grapefruit"), nsets = 2,
  setlabels = c("Fruits I like", "Fruits I tolerate"))

Run the code above in your browser using DataLab