Description Usage Arguments Details Value Author(s) Examples
copies lines of a source file (usually ‘.R’ oder ‘.Rd’) from R forge repository
1 2 3 4 5 6 | lstinputSourceFromRForge(PKG, TYPE, FILENAME, PROJECT, from, to,
offset.before = 0, offset.after = 0,
LineLength = getOption("width"),
withLines = ifelse(TYPE=="R", TRUE, FALSE),
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 |
vector of characters or vector of numerics or missing;
beginnings of the code sniplets; for details see
|
to |
vector of characters or vector of numerics or missing;
endings of the code sniplets; for details see |
offset.before |
numeric; numbers of lines to be included before the code sniplets; defaults to 0 |
offset.after |
numeric; numbers of lines to be included after the the code sniplets; defaults to 0 |
LineLength |
|
withLines |
logical; shall line-numbers be issued |
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 |
includes [downloaded] code sniplets in ‘.R’ ‘.Rd’ format
in some TeX-lstlistings
environment;
output is issued on stdout, hence included in ‘.Rnw’ file if wrapped to
1 2 3 |
For example
1 2 3 4 5 | <<BinomParam, results=tex, echo=FALSE>>=
lstinputSourceFromRForge("distr","man","BinomParameter-class.Rd","distr")
@
<<skew, results=tex, echo=FALSE>>=
|
lstinputSourceFromRForge("distrEx","R","Skewness.R","distr",
from = "\"skewness\", signature\\(x = \"Binom\"",
to = "\\}\\)")
1 | @
|
Within ‘.Rd’ code, examples are type-set in ‘.R’ style;
vectors are allowed for arguments from
, to
;
lstinputSourceFromRForge
uses
copySourceFromRForge
for download / reading from cache;
line numbers in the downloaded source may be printed out
invisible()
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | lstinputSourceFromRForge("distr","R","AllClasses.R","distr",
"## Class: BinomParameter", "#-")
lstinputSourceFromRForge("distr","R","AllClasses.R","distr",
from = "## Class: binomial distribution",
to = "contains = \"LatticeDistribution\"", offset.after = 1)
lstinputSourceFromRForge("distr","man","Binom-class.Rd","distr")
lstinputSourceFromRForge("distr","R","BinomialDistribution.R","distr",
from = c("## Access Methods", "## wrapped access methods"),
to = c("setReplaceMethod\\(\"prob\", \"BinomParameter\"",
"size = value\\)\\)") ,
offset.after = c(1,1))
lstinputSourceFromRForge("distr","R","BinomialDistribution.R","distr",
from = c(8,43,45), to = c(16,53,45))
lstinputSourceFromRForge("distr","R","BinomialDistribution.R","distr",
from = c("## Access Methods", "## wrapped access methods"),
to = c("setReplaceMethod\\(\"prob\", \"BinomParameter\"",
"size = value\\)\\)") ,
offset.after = c(1,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.