Bioconductor / BiocStyle

Issues and pull requests for BiocStyle should go here.
12 stars 19 forks source link

'argument of length 0' in simple vignette with R-3.6.3 / BiocStyle 2.14.4 / knitr 1.31 #85

Closed mtmorgan closed 3 years ago

mtmorgan commented 3 years ago

I'm not sure whether this is a bug w/ BiocStyle, or with knitr, or just obsolescence, but a simple vignette

$ cat BiocManager.Rmd
---
output:
  BiocStyle::html_document:
      toc: true
vignette: |
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r}
```

compiled under R-3.6.3 / Bioc 3.10 (i.e., 'r-oldrel-windows-ix86+x86_64' on CRAN) results in the error

/tmp$ bioc-3.10 CMD Sweave BiocManager.Rmd
Quitting from lines 11-11 (BiocManager.Rmd)
Error in if (is.na(options$out.width.px)) options$out.width.px = options$fig.width *  :
  argument is of length zero
Calls: <Anonymous> ... process_group.block -> call_block -> as.strict_list -> hook
Execution halted

It looks like the call stack is from knitr, but the lines if (is.na(options$out.width.px))... is present in BiocStyle, too...

> packageVersion("knitr")
[1] ‘1.31’
> packageVersion("BiocStyle")
[1] ‘2.14.4’
> sessionInfo()
R version 3.6.3 Patched (2020-02-29 r77906)
Platform: x86_64-apple-darwin17.7.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS:   /Users/ma38727/bin/R-3-6-branch/lib/libRblas.dylib
LAPACK: /Users/ma38727/bin/R-3-6-branch/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.6.3
grimbough commented 3 years ago

Is this the same as #78 , #80 & #81 ? The error message looks familiar.

IIRC that was the result of something changing in knitr which meant out.width.px was no longer defined at a point where it had been in older versions. We patched the relevant BiocStyle branches at the time, but I guess BioC 3.10 predates that.

It's the same scenario as that dplyr::filter_() thing that keeps cropping up with old R versions