title: How do I 'prebuild' a vignette index for an R package?
body: <p>I'm preparing a package for submission to <a href="http://cran.r-project.org/" rel="nofollow noreferrer">CRAN</a>.
  I use <code>R CMD build myPackage</code> then <code>R CMD check myPackage --as-cran</code> and it passes all checks with no notes or warnings.
  However, each time I try to submit, I get the following error message from one of the CRAN maintainers:</p>
  
  <blockquote>
    <p>Package has a VignetteBuilder field but no prebuilt vignette index.</p>
  </blockquote>
  
  <p>As a start, I'd like to be able to reproduce the above error message on my own system (<code>R version 3.0.1</code>).</p>
  
  <p>The vignette <code>.Rnw</code> file looks like this:</p>
  
  <pre><code>%\VignetteEngine{knitr::knitr}
  %\VignetteIndexEntry{myVignetteName}
  \documentclass{article}
  \begin{document}
  Here is some code:
  &lt;&lt;&gt;&gt;=
  plot(1:10, 10:100)
  @
  \end{document}
  </code></pre>
  
  <p>I have tried adding an <code>INDEX</code> file in the root directory with a vignette entry like this:</p>
  
  <pre><code>myFunction       a brief description
  abc-vignette     vignette description
  </code></pre>
  
  <p>Again, this passes <code>R CMD check myPackage --as-cran</code> but I get the same error message.</p>
  
  <p>I have also tried <code>R CMD build myPackage --md5</code> to force creation of an <code>MD5</code> file, to no avail.</p>
  
  <p>When I look at <code>myPackage.Rcheck/00_pkg_src/myPackage/inst/doc</code> I find the vignette files, <code>.Rnw</code> and <code>.pdf</code> as expected.</p>
  
  <p>The package <code>DESCRIPTION</code> file has the following entry:</p>
  
  <pre><code>VignetteBuilder: knitr
  Suggests: knitr
  </code></pre>
  
  <p>When I look at <code>myPackage.Rcheck/myPackage/Meta</code> I see an entry <code>vignette.rds</code>. However this appears to be a binary file, so I can't make sense of it.</p>
  
  <p>This is from 'writing R extensions':</p>
  
  <blockquote>
    <p>At install time an HTML index for all vignettes in the package is automatically created
    from the \VignetteIndexEntry statements unless a file ‘index.html’ exists in directory ‘inst/doc’. This index is linked from the HTML help index for the package. If you do supply a ‘inst/doc/index.html’ file it should contain relative links only to files under the installed ‘doc’ directory, or perhaps (not really an index) to HTML help files or to the ‘DESCRIPTION’ file.</p>
  </blockquote>
  
  <p>So do I need to manually create <code>index.html</code> and could anyone point to an example of what this should look like?</p>
  
  <p><a href="http://r.789695.n4.nabble.com/vignette-index-going-AWOL-td4695996.html" rel="nofollow noreferrer">This question</a> appears closely related, but I do not (knowingly) have an <code>.Rbuildignore</code> file. <a href="https://github.com/hadley/devtools/issues/587" rel="nofollow noreferrer">This is also related</a>, although I'm not using <code>devtools</code> for package creation. I have also looked at <a href="https://stackoverflow.com/questions/19716498/using-a-static-prebuilt-pdf-vignette-in-r-package">this question</a> but am not seeing an easy answer.</p>
  
  <p><em>Update Jul 1</em></p>
  
  <p>For a reproducible example, the package is available <a href="https://github.com/dardisco/dxBinom" rel="nofollow noreferrer">here on github</a>. Downloading and installing (e.g. with <code>devtools::install_github()</code> should allow this error to be reproduced.</p>