[R-SIG-Finance] Beginning R metrics
Dirk Eddelbuettel
edd at debian.org
Mon Sep 11 03:05:26 CEST 2006
On 10 September 2006 at 16:49, Alexy Khrabrov wrote:
| In fact, I was asking for a way to sync the examples in the User
| Guides with the packages themselves -- what is the intended way to
| get the examples for fBasics shown in the fBasics.pdf in the sequence
| from the text? I.e., in fBasics.pdf, on page 32, there's sample code
| -- I wonder how one would load/see it, if it's available?
For the particular case, I think we have to defer to Rmetrics author on
that. Looking at the sources of fBasics here, I see that it has a demo/
directory so that you have the demo() commands as well -- try those.
For the general case, one would have to invent a way to link documentation
and examples in a generic fashion.
Now, it turns out that R actually solved that for the particular case of
vignette() documentation. For a given vignette foo, e.g. what you'd see by
issueing
> vignette("foo")
where my favourite example is probably the vignette of the zoo package, you
also get code included in the vignette via
> edit(vignette("foo"))
In other words, for my zoo example it is
> library(zoo) ## load the library
> vignette("zoo") ## display the pdf document
> edit(vignette("zoo")) ## extracts and displays the code
Now, for your particular case of fBasics et al, you are out of luck. Dr
Wuertz started the Rmetrics project way before R matured to the point that it
could support all of Rmetrics; luckily we are now at a point where R "can do"
Rmetrics.
However, Rmetrics' documentation precedes the vignette-style documentation
mechanism that was added to R in the last few years. So I am afraid you're
back to doing the extraction the manual way. Sorry!
Hope this help, Dirk
--
Hell, there are no rules here - we're trying to accomplish something.
-- Thomas A. Edison
More information about the R-SIG-Finance
mailing list