Learn R Programming

relax (version 1.3.15)

args.player: An interactive Tcl/Tk Tool for Evaluation of Functions Calls

Description

args.player is a simple tool for checking the effect of different inputs to a function. args.player creates a small Tcl/Tk widget showing the arguments of the function and the values of the arguments. The values can be modified by typing in new values. A click on the Eval button starts the function with the fixed parameters and you can consider the results.

Usage

args.player(fn.call, width.of.label = 20, width.of.entry = 25, main)

Arguments

fn.call
a function call or a function name
width.of.label
width of the region used for printing the argument names
width.of.entry
width of the entry fields for the values of the arguments
main
title for the widget

Details

There are two ways of usage: At first the input of args.player can be a complete function call. Then you should name the arguments correctly to prevent problems of identification. Secondly, it is possible to call args.player with a function name, only. In this case arguments will be searched by arg.

Examples

Run this code
# do not run
## Not run: 
#     args.player(mean)
# ## End(Not run)
## Not run:  
#     fun <- function(n = 100, m=0, sd=1, type="l", bty="n", 
#                     xlim = c(0,1), col = "red", main = "title" ){
#              x <- rnorm(n,m,sd)
#              plot(x, type=type, bty=bty, xlim = xlim, col = col, main = main)
#            }
#     args.player( 
#        fun( n = 100, m = 5, sd = 10, type = "l", bty = "n", 
#             xlim = c(0,10), col = "blue", main = "effect of plot parameters" ), 
#        main="some plot test" 
#     ) 
# ## End(Not run)

Run the code above in your browser using DataLab