CodeChunkPlayer: CodeChunkPlayer, ConstructDemo - tools for browsing and...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/relax.R

Description

CodeChunkPlayer enables the user to evaluate code chunks interactively. ConstructDemo constructs a demo function from a file containing code chunks.

Usage

1
2

Arguments

file

name of rev-, Snw-file or .R-file containing code chunks

Details

Both functions need a .R-file that has been generated by tangleR. If the input file is not a .R-file but an rev-file or an Snw-file the input file will be tangled by tangleR and a .R-file will be generated.

CodeChunkPlayer: CodeChunkPlayer extracts the code chunks stored in the .R-file and creates a Tcl/Tk window to show a code chunk selected by the user. The user can browse through the set of chunks by clicking on NEXT or bBACK or by typing the number of a code chunk. The code of the selected code chunk is shown in the text field of the player window and may be edited. By clicking button EVALUATE the code will be evaluated and the output occurs on the R console.

ConstructDemo: ConstructDemo extracts the code chunks of the .R-file and builds a new function for browsing through the code chunks. This function will contain the code chunks of the .R-file as well as the logic for browsing and evaluation of selected chunks. The function is stored with its call in a file whose name is composed from the name of the input file and the extension .demo.R. Therefore, you can start the demo function by e.g. source("xyz.demo.R") and a Tcl/Tk window for code chunk browsing will be created. This window works like the Tcl/Tk window that is generated by CodeChunkPlayer.

Value

CodeChunkPlayer and ConstructDemo don't have any explicit result.

Author(s)

Hans Peter Wolf

References

http://www.wiwi.uni-bielefeld.de/com/wolf/software/relax.html

Examples

1
2
## CodeChunkPlayer()
## ConstructDemo()

relax documentation built on May 30, 2017, 6:30 a.m.