> library(bayesm) > Rd <- utils:::.getHelpFile(?rwishart) > tools::Rd2ex(Rd)
Or you could use example() to get a character vector of the example code in a help file. library(bayesm) example(rwishart, give.lines=TRUE) Bill Dunlap TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Duncan Murdoch > Sent: Saturday, April 19, 2014 4:12 AM > To: gleyne...@gmail.com; r-help > Subject: Re: [R] R Example scripts > > On 18/04/2014, 6:07 PM, Gene Leynes wrote: > > A few years ago R changed the way help was handled so that the HTML > > files are no longer available in the library directory. Around that > > time the R example files that used to be in some of the libraries also > > vanished. > > > > I'm wondering where the "r-ex" folder went. Is it totally unsupported > > and gone? Is it hidden in the mysterious rdx or rdb files? > > The source for the examples will be in the \examples{} section of the > .Rd source file -- that didn't change. What changed was how the source > is processed. The files are now parsed into a binary format that is > stored in the database files. > > You can extract the examples from the source file using the tools::Rd2ex > function. You can extract them from the binary database using this > function on an Rd object, which is obtainable using the internal > function .getHelpFile. > > So for example, to see the code for the example for rwishart, you could do > > tools::Rd2ex(".../bayesm/man/rwishart.Rd") > > if you have the source file installed there, or > > library(bayesm) > Rd <- utils:::.getHelpFile(?rwishart) > tools::Rd2ex(Rd) > > if you have the package installed. > > Duncan Murdoch > > > > In particular I'm looking for the latest example scripts in the baysem > > package. I don't see them in the source code or the installed library. > > > > ______________________________________________ > > R-help@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.