From dtenenba at fhcrc.org  Fri Aug 23 22:40:19 2013
From: dtenenba at fhcrc.org (Dan Tenenbaum)
Date: Fri, 23 Aug 2013 13:40:19 -0700
Subject: [Rd] packages with Sweave and knitr vignettes?
In-Reply-To: <5217C508.8050004@yorku.ca>
References: <5217C508.8050004@yorku.ca>
Message-ID: <CAF42j22OZftA+A3xKrvV8exnYeTsTVUCuz0Yn3d+kwET_2z-SQ@mail.gmail.com>

On Fri, Aug 23, 2013 at 1:24 PM, Michael Friendly <friendly at yorku.ca> wrote:
> Now that R 3.0.0+ supports non-Sweave vignettes, R-exts \S 1.4.2 seems to
> imply that
> it is possible to include both Sweave and knitr vignettes in a single
> package.
>
> I'm wondering
> if anyone has tried this and/or if there are some hidden gotchas putting
> this into practice,
> and concerned about creating problems with CRAN checks if I try this.
>

You could easily find out. Add vign2.Rnw to your package, build it, then run
R CMD check --as-cran mypkg_.0.0.1.tar.gz

Dam


> Consider two vignettes:
>
> pkg/vignettes/vign1.Rnw, containing:
> % !Rnw weave = Sweave
> %\VignetteEngine{Sweave}
> ...
>
> pkg/vignettes/vign2.Rnw, containing:
> % !Rnw weave = knitr
> %\VignetteEngine{knitr::knitr}
> ...
>
> both are .Rnw files, distinguished only by \VignetteEngine. vign1.Rnw is
> currently in my
> package, and vign2.Rnw compiles OK outside it, using knitr in an R console
> or RStudio.
>
> R-exts implies that the DESCRIPTION file must include (minimally):
>
> VignetteBuilder: Sweave, knitr
> Suggests: knitr
>
> Is anything more/different required?  Does a package exist that does this?
>
> TIA
> -Michael
>
> --
> Michael Friendly     Email: friendly AT yorku DOT ca
> Professor, Psychology Dept. & Chair, Quantitative Methods
> York University      Voice: 416 736-2100 x66249 Fax: 416 736-5814
> 4700 Keele Street    Web:   http://www.datavis.ca
> Toronto, ONT  M3J 1P3 CANADA
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] packages with Sweave and knitr vignettes?
Dan Tenenbaum