adding a package Vignette to the Vignettes menu when loading package
1
0
Entering edit mode
Ana Conesa ▴ 140
@ana-conesa-925
Last seen 9.6 years ago
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)
• 710 views
ADD COMMENT
0
Entering edit mode
rgentleman ★ 5.5k
@rgentleman-7725
Last seen 9.0 years ago
United States
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 >
ADD COMMENT

Login before adding your answer.

Traffic: 755 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6