copySourceFromRForge: copySourceFromRForge

Description Usage Arguments Details Value Author(s) Examples

View source: R/SweaveListingUtils.R

Description

copies lines of a source file (usually ‘.R’ oder ‘.Rd’) from R forge repository

Usage

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"), ... )

Arguments

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

...

further arguments to be passed on to link[base]{grep}

Details

produces a vector of characters where each component is one line of the original source file; arguments from, to may be

with offsets, additional lines may be pasted before and after the search result

Value

the character content of the filtered source file, if nothing is found it returns invisible().

Author(s)

Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de

Examples

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 ="\\}")

SweaveListingUtils documentation built on May 30, 2017, 6:29 a.m.