Replacing the vignette with a new version - r

I submitted an R Package to CRAN a couple of months back which is currently available as a package. I submitted the vignette along with the package. Now I have an updated version of my vignette which I need to replace with the old vignette. How to proceed?
I checked in How to put a link to another vignette in the same R package in a vignette
but that lacks clarity to what I'm looking for.
Please help. Thanks.
PS. I have a PDF file of the vignette

Related

Vignette Table of Contents Missing When Package Published to CRAN

I recently released a vignette with version 1.1 of my R package. The Rmd for the vignette can be found here. When I create the vignette locally, I see author information and the table of contents at the top of the vignette, as expected. However, when I submitted this package to CRAN and the vignette was created there, I no longer see the table of contents or author information. Does anyone know why this may be happening?
Thanks.
I glanced at your DESCRIPTION here and noticed that the VignetteBuilder field does not contain rmarkdown. Since you are using knitr::rmarkdown as an engine, I suspect that you need:
VignetteBuilder: knitr, rmarkdown
Here is a relevant paragraph from the R-exts manual:
The VignetteBuilder field names (in a comma-separated list) packages that provide an engine for building vignettes. These may include the current package, or ones listed in Depends, Suggests or Imports. The utils package is always implicitly appended. See Non-Sweave vignettes for details. Note that if, for example, a vignette has engine knitr::rmarkdown, then knitr provides the engine but both knitr and rmarkdown are needed for using it, so both these packages need to be in the VignetteBuilder field and at least suggested (as rmarkdown is only suggested by knitr, and hence not available automatically along with it). Many packages using knitr also need the package formatR which it suggests and so the user package needs to do so too and include this in VignetteBuilder.
This is not a guaranteed fix, but it is maybe a first step.

Is there a special .Rmd template to create R package vignette in pdf?

I'm developing my first R package and I'm trying to produce a pdf vignette for the package. I have read some documents and online tutorial about producing package vignettes by the tools such as rmarkdown and knitr. I implemented some steps and produced a pdf vignette. However, having a look on the pdf vignettes of some packages like:
https://cran.r-project.org/web/packages/rmarkdown/rmarkdown.pdf
https://cran.r-project.org/web/packages/cluster/cluster.pdf
https://cran.r-project.org/web/packages/lmom/lmom.pdf
https://cran.r-project.org/web/packages/lmomRFA/lmomRFA.pdf
https://cran.r-project.org/web/packages/e1071/e1071.pdf
, it seems that there is a special template to produce pdf vignettes of R packages. Is there such a template? If yes, how can I find and use it?
Thanks in advance for any help
As mentioned in the comments I've mistaken reference manuals as vignettes and so, I hadn't be able to find the correct answer. When I searched by using the correct keywords, I found the correct answer:
https://devtools.r-lib.org/reference/build_manual.html
https://cran.r-project.org/web/packages/Rd2md/vignettes/Introduction.html
R create reference manual with R CMD check

invisible functions description in own package

I've just created my first package and I have some problems with description. I was trying to use vignette with code usethis::use_vignette("introduction") and it creates introduction to package and to included functions. To see it I pressed "knit" button and it works, look nice etc.. I also create new R script and use library('mypackage') and all function work, but I have no idea how can I see my vignette (description of package and functions). For example in packages like ggplot2 or graphics you can just put ??ggplot2, ??graphics to just see description of package. But putting ??mypackage I see in R help 'No results found'. How can I see this created vignette not in model building tools, but in new script which refers to my package.
RStudio's build and reload does not build vignettes by default. You'll need to use devtools::build() to ensure vignettes are built. If you are using Github to install the package use devtools::install_github("package", build_vignettes = TRUE)

R package choroplethr says use zip_choroplethr instead of zip_map, but function not available

I did install.packages("choroplethr"), followed by library(choroplethr). I want to find out how to do a zip code choropleth, so I start typing in RStudio,
"?choroplethr::zip..." The only function that RStudio finds is zip_map. I go to its help file and see the following documentation:
This function is deprecated as of choroplethr version 3.0.0. Please
use ?zip_choropleth instead. The last version of choroplethr in which
this function worked was version 2.1.1, which can be downloaded from
CRAN here:
http://cran.r-project.org/web/packages/choroplethr/index.html
Okay, I guess I'll find out about this zip_choroplethr function then.
?choroplethr::zip_choroplethr
# No documentation for ‘zip_choroplethr’ in specified packages and libraries:
# you could try ‘??zip_choroplethr’
Wut.
Thank you for using choroplethr.
zip_map is, indeed, deprecated. It used scatterplots, which wasn't the best way to visualize zip codes, especially because they are so small.
Within choroplethr, Zip code choropleths are managed by a new, separate package: choroplethrZip. You can see the installation instructions and documentation here.
CRAN rejected choroplethrZip due to the size of the map, which is why it is in separate package and on github.

What are good example R packages written using RUnit or roxygen?

I'm writing an R package that's going to be used by others, so I'm trying to get this one right! I want to use roxygen for documentation and RUnit for unit testing, but I haven't used them before.
What packages exist (either on CRAN or elsewhere) that use either of these tools well?
Roxygen is used in Hadley's stringr (see also this previous SO question: R documentation with Roxygen), mutatr and testthat packages.
But testthat is used for testing in the mentioned packages instead of RUnit.
If you look at the RUnit page at CRAN you see the list of of packages that have a Depends:, Imports: or Suggests: on it. Maybe try one of those? The list includes plyr and a bunch of Rmetrics packages.
Likewise, the roxygen page at CRAN can be looked at but it only lists a single package.

Resources