Re: [R] cacheSweave / pgfSweave driver for package vignette
Thank you everyone, I think I'll follow the technique used in Rcpp (dummy vignettes + Makefile). It would be great to have a mechanism to select the driver for vignette generation though. Also, as a side-note, the choice of a driver has its own shortcoming; I cannot use the features of highlight and, say, pgfSweave in the same document. Sincerely, baptiste On 13 August 2010 11:10, Romain Francois romain.franc...@dbmail.com wrote: Hi, I've been meaning to ask the same question before. Le 13/08/10 11:01, baptiste auguie a écrit : Dear list, I wish to use a specific driver to process an sweave document in the inst/doc directory of a package. Specifically, I would like to use either cacheSweave or pgfSweave to speed up the creation of the vignette which requires lengthy computations. The same request would also apply to the highlight driver, to provide syntax highlighting of R chunks. In writing R extensions I see that during R CMD BUILD Sweave is run first, then optionally a makefile can be used to process any other files. It doesn't seem to leave room for a choice of Sweave engine, as far as I understand. One option I am thinking of is to change the extension of the source file to something like .Rnw2 so that Sweave ignores it altogether, and then use the appropriate command in a makefile. This is what we do in Rcpp to build our 7 vignettes (since we like to use the driver from highlight). One thing to have in mind is that R needs the .Rnw file to be present in doc once the package is installed, so that the vignette function works, hence some trickery in Rcpp. A way to control which sweave (and perhaps tangle) driver is to be used for a particular vignette would be very useful. Romain I have no experience in writing makefiles, so I'm hoping someone would already have solved this issue and could provide some advice. Sincerely, baptiste -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th |- http://bit.ly/aAyra4 : highlight 0.2-2 `- http://bit.ly/94EBKx : inline 0.3.6 __ 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.
Re: [R] cacheSweave / pgfSweave driver for package vignette
Le 14/08/10 19:13, baptiste auguie a écrit : Thank you everyone, I think I'll follow the technique used in Rcpp (dummy vignettes + Makefile). Cool. Let us (Rcpp team) know if you find better ways or if something is too much trickery. It would be great to have a mechanism to select the driver for vignette generation though. Also, as a side-note, the choice of a driver has its own shortcoming; I cannot use the features of highlight and, say, pgfSweave in the same document. It should be possible to create a new driver that combines both features. Let me (highlight team) know if I can do something in highlight to make this easier than it currently is. Romain Sincerely, baptiste On 13 August 2010 11:10, Romain Francoisromain.franc...@dbmail.com wrote: Hi, I've been meaning to ask the same question before. Le 13/08/10 11:01, baptiste auguie a écrit : Dear list, I wish to use a specific driver to process an sweave document in the inst/doc directory of a package. Specifically, I would like to use either cacheSweave or pgfSweave to speed up the creation of the vignette which requires lengthy computations. The same request would also apply to the highlight driver, to provide syntax highlighting of R chunks. In writing R extensions I see that during R CMD BUILD Sweave is run first, then optionally a makefile can be used to process any other files. It doesn't seem to leave room for a choice of Sweave engine, as far as I understand. One option I am thinking of is to change the extension of the source file to something like .Rnw2 so that Sweave ignores it altogether, and then use the appropriate command in a makefile. This is what we do in Rcpp to build our 7 vignettes (since we like to use the driver from highlight). One thing to have in mind is that R needs the .Rnw file to be present in doc once the package is installed, so that the vignette function works, hence some trickery in Rcpp. A way to control which sweave (and perhaps tangle) driver is to be used for a particular vignette would be very useful. Romain I have no experience in writing makefiles, so I'm hoping someone would already have solved this issue and could provide some advice. Sincerely, baptiste -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th `- http://bit.ly/aAyra4 : highlight 0.2-2 __ 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.
Re: [R] cacheSweave / pgfSweave driver for package vignette
Hi, I've been meaning to ask the same question before. Le 13/08/10 11:01, baptiste auguie a écrit : Dear list, I wish to use a specific driver to process an sweave document in the inst/doc directory of a package. Specifically, I would like to use either cacheSweave or pgfSweave to speed up the creation of the vignette which requires lengthy computations. The same request would also apply to the highlight driver, to provide syntax highlighting of R chunks. In writing R extensions I see that during R CMD BUILD Sweave is run first, then optionally a makefile can be used to process any other files. It doesn't seem to leave room for a choice of Sweave engine, as far as I understand. One option I am thinking of is to change the extension of the source file to something like .Rnw2 so that Sweave ignores it altogether, and then use the appropriate command in a makefile. This is what we do in Rcpp to build our 7 vignettes (since we like to use the driver from highlight). One thing to have in mind is that R needs the .Rnw file to be present in doc once the package is installed, so that the vignette function works, hence some trickery in Rcpp. A way to control which sweave (and perhaps tangle) driver is to be used for a particular vignette would be very useful. Romain I have no experience in writing makefiles, so I'm hoping someone would already have solved this issue and could provide some advice. Sincerely, baptiste -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th |- http://bit.ly/aAyra4 : highlight 0.2-2 `- http://bit.ly/94EBKx : inline 0.3.6 __ 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.
Re: [R] cacheSweave / pgfSweave driver for package vignette
On Fri, Aug 13, 2010 at 5:01 AM, baptiste auguie baptiste.aug...@googlemail.com wrote: Dear list, I wish to use a specific driver to process an sweave document in the inst/doc directory of a package. Specifically, I would like to use either cacheSweave or pgfSweave to speed up the creation of the vignette which requires lengthy computations. The same request would also apply to the highlight driver, to provide syntax highlighting of R chunks. In writing R extensions I see that during R CMD BUILD Sweave is run first, then optionally a makefile can be used to process any other files. It doesn't seem to leave room for a choice of Sweave engine, as far as I understand. One option I am thinking of is to change the extension of the source file to something like .Rnw2 so that Sweave ignores it altogether, and then use the appropriate command in a makefile. I have no experience in writing makefiles, so I'm hoping someone would already have solved this issue and could provide some advice. If its just a matter of running the vignette offline then the Ryacas package uses an approach which does not require a special driver and is simple enough that it does not really require make files. See Ryacas.Rnw in the source: http://code.google.com/p/ryacas/source/browse/#svn/trunk/inst/doc __ 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.
Re: [R] cacheSweave / pgfSweave driver for package vignette
Dear all, Maybe we should move the discussion to r-devel? So please excuse the cross-posting, it is to tell people at r-help where to find the rest of the discussion (in case you agree with me). I've been wondering about that, too. Gabor, I use fake vignettes along your lines, too. In order to provide meaningful samples, I have both bulky data and bulky calculations (at least too long to have any fun in running R CMD check frequently). As I do not want to burden my package with lots ( 60 MB) of raw data in various file formats, two vignettes do their real work extra (and the source is available for separate download). So for the development work it would be good to have caching for speed-up. For the testing purposes of R CMD CHECK, however, the whole thing needs to be calculated: afaik the caching mechanism checks for changes in the respective chunks. Which is great for data-analysis work. However, in a package development scenario the changes are rather expected in the package. I suspect that the caching cannot check this. Thus a cached vignette does greatly reduce the calculation time, but also knocks out part of the testing. This would be without concern, if the package is well behaved and does its testing in the tests and has the vignettes as manuals. I have to admit, though, that my package is not (yet) at this point. So I personally find myself with a shell script that automatically builds all vignettes first, transfers some files into the package (the data sets coming with the package are constructed in vignettes), and then check and build the package. In the end, this dependency of the package on the results of its vignettes needs much more calculation. I'm talking of ca. 10 - 15 min for the whole process (i.e. 5 - 7 min for one check cycle). This is awkward for development, but I think it's OK for something to be done occasionally on a nightly check on the server. My conclusion is, that a cached Sweave driver should only be specified in certain situations. I.e. it would be very helpful for developing to do this at home, but I'm afraid it is not the best idea to reduce the work in checking the package in general (e.g. during nightly checks). I also say this because I have been running into trouble with the nighly build on r-forge (due to some LaTeX packages that I thought to be fairly standard, which they weren't). Another error I like to produce is to forget adding a new source file to the version control. Both cases are only found in checks during the nightly build on the server. There may be other mistakes that would be masked by the caching. Of course, it is also not nice to keep the servers calculating examples for hours. I presume, however, that this case is quite rare (compared to situations where the regular building and checking is too long for a fluent development cycle), and I'd say that in this case Gabor's procedure is OK. For my work it would be much more helpful, if R CMD CHECK had also positive flags (e.g. --tests as abbreviation for --no-codoc --no-examples --no-install --no-vignettes --no-latex) I know hardly anything about make files and never wrote one myself. I think they could be helpful here to switch between the development checks and a complete build check. So I'd be very curious to see some make files. HTH, Claudia -- Claudia Beleites Dipartimento dei Materiali e delle Risorse Naturali Università degli Studi di Trieste Via Alfonso Valerio 6/a I-34127 Trieste phone: +39 0 40 5 58-37 68 email: cbelei...@units.it __ 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.