codeChunk-class {DynDoc} | R Documentation |
Class "codeChunk"
Description
A class to wrap necessary information for a code chunk from a vignette file.
Objects from the Class
Objects can be created by calls of the form new("codeChunk", ...)
.
Slots
chunkName
:Object of class
"character"
The name (if one exists) for the code chunkchunk
:Object of class
"character"
The code from the code chunkoptions
:Object of class
"SweaveOptions"
Any options that were set at the time the code chunk appears in the vignette file
Methods
- evalChunk
signature(object = "codeChunk", env="environment")
: Will evaluate the code in the code chunk using the environment specified. If no environment is specified, .GlobalEnv is used.- show
signature(object = "codeChunk")
: Displays the information for the code chunk- chunk<-
signature(object = "codeChunk", value="character")
: Edits thechunk
slot of the object- chunk
signature(object = "codeChunk")
: Returns thechunk
slot of the object- chunkName
signature(object = "codeChunk")
: Returns the name of the code chunk- getOptions
signature(object = "codeChunk")
: Returns the actual options from theoptions
slot.- SweaveOptions
signature(object = "codeChunk")
: Returns the object stored in theoptions
slot.
Author(s)
Jeff Gentry
See Also
Sweave
, SweaveOptions
, chunkList
Examples
require("utils")
testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package="utils")
z <- Stangle(testfile,driver=tangleToR)
getChunk(z,1)