[BioC] adding a package Vignette to the Vignettes menu when loading package

Robert Gentleman rgentlem at fhcrc.org
Wed Aug 31 03:03:01 CEST 2005


Hi Ana,
   That depends on whether your package will have a name space or not. 
If you look at the R extensions manual it gives a bit of guidance on the 
differences between loading and attaching when name spaces are involved.

   If you do not have a name space (no NAMESPACE file) then you should 
put it in a function named .First.lib, see the relevant manual page for 
specific details.

   If you do have a name space then you should put it in either (but not 
both)
   .onLoad, or .onAttach depending on whether you want users to see your 
vignette when the package is loaded, or only when it is attached. 
Probably the latter is most appropriate. You might also consider putting 
something in .onUnload to take it off the menu if/when the package is un 
loaded.

   Best wishes,
     Robert

Ana Conesa wrote:
> Dear all, 
> 
> I am building a R package and I would like to add a vigenette to it. 
> I wrote my vignette in Sweave format and put it in the inst\doc subdirectory 
> of my source package directory and when I run Rcmd build the pdf file is 
> created correcly. I would like now to make the vignette availble for users in 
> the menu Vignettes of the Windows Rgui. I have found the following code that 
> does this:
> 
> if(.Platform$OS.type == "windows" && require(Biobase) && interactive() 
> && .Platform$GUI == "Rgui") {
> addVigs2WinMenu("maSigPro")
> 
> This code works when I run it within a R session, but I would like that it is 
> directly executed when I load my package. Which is the place to put this 
> piece of code within the package (building process) to reach this 
> functionality?
> 
> Thanks,
> 
> 
> Ana Conesa
> 
> Centro de Genómica
> Instituto Valenciano de Investigaciones Agrarias
> Moncada
> Spain
> 
> --
> IVIA (http://www.ivia.es)
> Open WebMail Project (http://openwebmail.org)
> Debian Project (http://www.debian.org)
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
>



More information about the Bioconductor mailing list