Description Usage Arguments Details Value Author(s) Examples
View source: R/SweaveListingUtils.R
copies lines of a source file (usually ‘.R’ oder ‘.Rd’) from R forge repository
1 2 3 4 | copySourceFromRForge(PKG, TYPE, FILENAME, PROJECT, from, to,
offset.before = 0, offset.after = 0,
fromRForge = getSweaveListingOption("fromRForge"),
base.url = getSweaveListingOption("base.url"), ... )
|
PKG |
character; name of package to be downloaded |
TYPE |
character; style of the source code — "man" or "R" |
FILENAME |
character; the name of the source file to be downloaded |
PROJECT |
character; the name of the R-Forge project |
from |
single character or single numeric or missing; if character,
the starting string being searched (by |
to |
single character or single numeric or missing; if character,
the ending string being searched (by |
offset.before |
numeric; number of lines to be included before the first match; defaults to 0 |
offset.after |
numeric; number of lines to be included after the first match; defaults to 0 |
fromRForge |
logical; shall code be downloaded from an R-Forge mirror? Defaults to the corresponding global option |
base.url |
character; base url from where to download the code sniplet |
... |
further arguments to be passed on to |
produces a vector of characters where each component is one line of
the original source file;
arguments from, to may be
missing: then the whole file (resp. from the beginning or to the end) is used
numbers: then the limits are just given as line numbers
characters: then file is searched for the first occurrance of a passage
framed by from, to; it uses grep; hence
regular expressions may be used which involves masking
of (,{,\, etc. as described in the cited reference;
with offsets, additional lines may be pasted before and after the search result
the character content of the filtered source file,
if nothing is found it returns invisible().
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
1 2 3 4 5 | copySourceFromRForge("distr","R","AllClasses.R","distr", from =2, to =3,
offset.after=2)
copySourceFromRForge("distr","R","AllClasses.R","distr", from ="setClass",
to ="\\}")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.