notangle: Extract code from a noweb object

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/noweb.R

Description

Extract a named bit of code from the noweb source of R functions

Usage

1
notangle(file, target = "*", out, syntax = nowebSyntax, ...)

Arguments

file

an input file containing noweb code, or alternately an object of class noweb as created by the nwread function.

target

the target code chunk to extract. The parent .Rnw file will contain <<chunk-name>> directives. A standard approach is to use * as the name of a chunk that will extract all the code fragments.

out

a file name on which to write the result. By default this will be the name of the target with ".R" added, or if the target is "*" it will be the name of the input file with it's final suffix changed to ".R". A value of out=NULL can be used to suppress file creation.

syntax

defines the syntax to detect code chunks. This would rarely if ever be changed by a user.

...

extra arguments; unused. (Compatability with Sweave).

Value

A character vector containing the code, with the invisible attribute set to prevent automatic printing.

Author(s)

Terry Therneau

References

N Ramsay. Literate programming simplified. IEEE Software 11:97-105, 1994.

See Also

noweave

Examples

1
2
3
4
5
## Not run: 
 # Extract the nwread function
 notangle("noweb.Rnw", "nwread")

## End(Not run)

noweb documentation built on Oct. 30, 2019, 11:39 a.m.