copySourceFromRForge {SweaveListingUtils} | R Documentation |
copies lines of a source file (usually ‘.R’ oder ‘.Rd’) from R forge repository
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 grep , hence as regular expression);
if numeric, the starting line number, if missing we begin with the first line
of the file |
to |
single character or single numeric or missing; if character,
the ending string being searched (by grep , hence as regular expression);
if numeric, the ending line number, if missing we end with the last line
of the file |
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 |
produces a vector of characters where each component is one line of
the original source file;
arguments from
, to
may be
from
, to
; 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@itwm.fraunhofer.de
copySourceFromRForge("distr","R","AllClasses.R","distr", from =2, to =3, offset.after=2) copySourceFromRForge("distr","R","AllClasses.R","distr", from ="setClass", to ="}")