Title: | The 'noweb' System for R |
Maintainer: | Terry Therneau <terry.therneau@mayo.edu> |
Priority: | optional |
Version: | 1.1-4 |
Author: | Terry Therneau |
Description: | The noweb system for source code, implemented in R. |
License: | LGPL-2 |
VignetteBuilder: | noweb |
NeedsCompilation: | no |
LazyData: | true |
Date: | 2024-01-29 |
Packaged: | 2024-01-29 23:03:11 UTC; therneau |
Repository: | CRAN |
Date/Publication: | 2024-01-30 03:20:03 UTC |
Extract code from a noweb object
Description
Extract a named bit of code from the noweb source of R functions
Usage
notangle(file, target = "*", out, syntax = nowebSyntax, ...)
Arguments
file |
an input file containing noweb code, or alternately
an object of class |
target |
the target code chunk to extract. The parent .Rnw file
will contain |
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 |
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
Examples
## Not run:
# Extract the nwread function
notangle("noweb.Rnw", "nwread")
## End(Not run)
Extract documentation from a noweb object
Description
Write a TeX file from a noweb source file.
Usage
noweave(file, out, indent=1, syntax=nowebSyntax, ...)
Arguments
file |
an input file containing noweb code, or alternately
an object of class |
out |
a file name on which to write the result. By default this will be the name of the input file with it's final suffix changed to ".tex". |
indent |
the amount to indent code chunks |
syntax |
defines the syntax to detect code chunks. This would rarely if ever be changed by a user. |
... |
extra arguments; unused. (Compatability with Sweave). |
Details
R code written using noweb is a mixture of Latex documentation and
chunks of R code. The noweave
command formats these into a TeX
document which is designed to explain the code to a human.
The notangle
command writes out R files for the computer's use.
Author(s)
Terry Therneau
See Also
Examples
## Not run:
# Create the TeX file of documentation for the noweb library
noweave("noweb.Rnw"
## End(Not run)
Style file for noweb documents
Description
Style file for noweb documents
Usage
noweb.sty
Format
vector of character strings
Details
Latex files created by the noweave command will contain the line
usepackage{noweb}
, which in turn will try to load the file
noweb.sty
. A copy of this file needs to be either in the local
directory or on the search path used by Latex.
This data set is a copy of the file; create a disk copy for Latex by
using write(noweb.sty, file="noweb.sty")
.