Learn R Programming

TeachingDemos (version 1.2)

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)

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.

Value

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

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

slider

Examples

Run this code
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