CodeChunkPlayer enables the user to evaluate code chunks interactively.
ConstructDemo constructs a demo function from a file containing code chunks.
name of rev-, Snw-file or .R-file containing code chunks
Both functions need a .R-file that has been generated by
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 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 b
BACK 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 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.
a Tcl/Tk window for code chunk browsing will be created.
This window works like the Tcl/Tk window that is generated by
ConstructDemo don't have any explicit result.
Hans Peter Wolf
## CodeChunkPlayer() ## ConstructDemo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.