Learn R Programming

TeachingDemos (version 2.13)

sliderv: Create a Tk slider window

Description

Create a Tk slider window with the sliders positioned vertically instead of horizontally.

Usage

sliderv(refresh.code, names, minima, maxima, resolutions, starts,
  title = "control", no = 0, set.no.value = 0)

Value

Returns the value of a given slider when used as: slider(no=i).

Arguments

refresh.code

Function to be called when sliders are moved.

names

Labels for the sliders.

minima

Vector of minimum values for the sliders.

maxima

Vector of maximum values for the sliders.

resolutions

Vector of resolutions for the sliders.

starts

Vector of starting values for the sliders.

title

Title to put at the top of the Tk box.

no

The number of the slider whose value you want.

set.no.value

Vector of length 2 with the number of slider to set and the new value.

Author

Greg Snow 538280@gmail.com

Details

This is a variation on the slider function with vertical sliders arranged in a row rather than horizontal sliders arranged in a column.

This is based on an early version of slider and therefore does not have as many bells and whistles (but sometimes fits the screen better).

See Also

tkexamp, slider

Examples

Run this code
if(interactive()){
face.refresh <- function(...){
	vals <- sapply(1:15, function(x) slider(no=x))
	faces( rbind(0, vals, 1), scale=F)
}

sliderv( face.refresh, as.character(1:15), rep(0,15), rep(1,15),
	rep(0.05, 15), rep(0.5,15), title='Face Demo')
}

Run the code above in your browser using DataLab