[Rd] Non-vignette sweave file in package

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Fri Apr 5 14:01:59 CEST 2013


Dear Duncan,

Thanks a lot for the advice.

When I place the Rnw file in inst/doc it is treated as a vignette, which I don't want. Placing it in inst/sweave works fine. I can compile it either as you suggested in R or from the command line with R CMD Sweave --pdf path.to.R.library/mypkg/sweave/mydoc.rnw

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey


-----Oorspronkelijk bericht-----
Van: Duncan Murdoch [mailto:murdoch.duncan at gmail.com]
Verzonden: donderdag 4 april 2013 19:04
Aan: ONKELINX, Thierry
CC: r-devel at r-project.org
Onderwerp: Re: [Rd] Non-vignette sweave file in package

On 04/04/2013 10:55 AM, ONKELINX, Thierry wrote:
> Dear all,
>
> I'm documenting an elaborate analysis as a private package. The package writes all required output to a database. I use a Sweave file to transform all the results from the database into a report.
>
> Now I would like to add this Sweave to my package. I'm a bit puzzled on how to do that. It is not a vignette: the data is not available when the package is build and I need to recompile the Sweave file on demand (after the analysis was run).
>
> So I have two questions.
> 1) Where to put a non-vignette Sweave file in a package.
> 2) How do I compile that Sweave file.

1) You can put it anywhere you like in the inst directory, but "doc"
might make sense (if it doesn't trigger warnings about a badly formed vignette, I haven't checked).  When installed, it moves up one level.
So ".../inst/doc/mydoc.Rnw"
will be retrievable as system.file("doc/mydoc.Rnw", package="mypkg").

2) Use Sweave() and tools::texi2pdf().  You might want to write your own function that calls those, after saving the data in the appropriate place.

Duncan Murdoch

>
> Best regards,
>
> Thierry
>
> ir. Thierry Onkelinx
> Instituut voor natuur- en bosonderzoek / Research Institute for Nature
> and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality
> Assurance Kliniekstraat 25
> 1070 Anderlecht
> Belgium
> + 32 2 525 02 51
> + 32 54 43 61 85
> Thierry.Onkelinx at inbo.be
> www.inbo.be
>
> To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
> ~ Sir Ronald Aylmer Fisher
>
> The plural of anecdote is not data.
> ~ Roger Brinner
>
> The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
>
> * * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * *
> * Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
> The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.



More information about the R-devel mailing list