Skip to content

[R-pkg-devel] R vignettes

10 messages · Danielle Maeser, Duncan Murdoch, Gábor Csárdi +1 more

#
Hello,

I am doing a R CMD check on an R package I have developed. However, I keep
receiving the warning below:

*Files in the 'vignettes' directory but no files in 'inst/doc':*

And

*Files named as vignettes but with no recognized vignette engine:*

I am pretty sure I have the correct YAML header for my vignettes, and also
inst/docs is an older convention for vignettes that's no longer
recommended.

Do you have an idea of what's going wrong? I have attached my YAML header
below as reference.

Sincerely,
Danielle







*title: "title of this vignette"author: "name"output:
markdown::html_vignettevignette: >  %\VignetteIndexEntry{vignette title}
%\VignetteEngine{knitr::markdown}  %\VignetteEncoding{UTF-8}*
#
On 28/04/2021 2:44 p.m., Danielle Maeser wrote:
You may be missing the line

   VignetteBuilder: knitr

in your DESCRIPTION file.  Without that, R won't know how to interpret 
your vignette.

It's also a little unusual to use

   %\VignetteEngine{knitr::markdown}

nowadays; the more common engine is knitr::rmarkdown (but I believe both 
are still supported).  If you make this change you should also have

   rmarkdown::html_vignette

as the output format.

Finally, since a recent update of knitr, you need to make sure that 
package holding the output format (i.e. markdown currently, rmarkdown if 
you make the change above) is declared as a Suggested package in your 
DESCRIPTION file.

Duncan Murdoch
#
Hi Duncan,

Thank you for your feedback!

Unfortunately, when I made the changes recommended I have a new error:


*trying to use CRAN without setting a mirror*

And:
*Error: 'col_ed' is not an exported object from 'namespace:cli'*

My description file includes:







*VignetteBuilder: knitrDepends: R (>= 4.0), knitrLicense: GPL-2Encoding:
UTF-8Roxygen: list(rmarkdown = TRUE)RoxygenNote: 7.1.1  LazyData:
trueSuggests: knitr, rmarkdown*

And my vignette includes:






*title: "title"author: "name"output: rmarkdown::html_vignettevignette: >
%\VignetteIndexEntry{title}  %\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}*

I'd appreciate any advice!

Danielle

On Wed, Apr 28, 2021 at 2:27 PM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

  
    
#
On 28/04/2021 4:41 p.m., Danielle Maeser wrote:
That would be a result of your code.  Do you call install.packages() in 
one of your functions?  Normally you shouldn't do that.
Similarly, something in your code or NAMESPACE file.  Do you refer to 
cli::col_ed, or try to import col_ed from cli?
Do you really have a data subdir in your package? You shouldn't have the 
LazyData line without one.
You shouldn't list knitr in both Depends and Suggests.

Duncan Murdoch
#
Hi Duncan,

I really appreciate your response. Unfortunately, I am still receiving the
error below.

If anyone has ideas, I'd appreciate it!

This is the only online forum I can find that discusses the error, but I
have not found it helpful: https://github.com/r-lib/cli/issues/94




*   ERROR: package installation failedError: 'col_ed' is not an exported
object from 'namespace:cli'Execution halted*

On Wed, Apr 28, 2021 at 7:32 PM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

  
    
#
If you could share a reproducible example with us, and/or you could
show the full output, then we could probably help you better.

Gabor
On Thu, Apr 29, 2021 at 6:29 PM Danielle Maeser <maese005 at umn.edu> wrote:
#
Hi Gabor,

My full output is below:









*   Error: object 'col_ed' is not exported by 'namespace:cli'   Execution
halted   ERROR: lazy loading failed for package 'packagename'
 -----------------------------------   ERROR: package installation
failedError: 'col_ed' is not an exported object from
'namespace:cli'Execution haltedExited with status 1.*

Unfortunately, I can't share a full reproducible example since this package
is also included in a manuscript for publication.

I don't export any objects named 'col_ed' so I am quite perplexed by this
error message.

I'd appreciate any advice!

Danielle

On Thu, Apr 29, 2021 at 11:42 AM G?bor Cs?rdi <csardi.gabor at gmail.com>
wrote:

  
    
#
That's not the _full_ output, unfortunately. And if you can't share a
file that reproduces this (not necessarily your original file!), then
Duncan's advice is all we can tell you: don't install packages in
vignettes.

Gabor
On Thu, Apr 29, 2021 at 7:34 PM Danielle Maeser <maese005 at umn.edu> wrote:
#
On 29/04/2021 1:34 p.m., Danielle Maeser wrote:
This isn't about exports, it's about imports.  R thinks you are trying 
to use an object named col_ed from the cli package.

What I would do is search all source files in your package for "col_ed" 
to see where it is being used.  Then figure out why R thinks you are 
trying to get it from the cli package.

Duncan Murdoch
#
cli does export col_red - did you omit the 'r' when calling it from your
package or vignette?
On Thu, Apr 29, 2021 at 9:29 AM Danielle Maeser <maese005 at umn.edu> wrote: