I'm new to officedown. I'm currently reviewing it to see if the company wants to use it in production. I'm having problems producing output from one of their examples: minimal_word.Rmd. Weirdly, I am able to run all their other examples (also in github) with no issues, so this is puzzling me, as they have similar settings and uses. I thought it might be a package missing or something, but my guess is that then the other examples would also crash and they don't.
I've tried to locate which parts of the code are causing my issue to try to create a minimal-minimal example to add here:
---
title: "officedown example"
output:
officedown::rdocx_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.cap = TRUE)
library(officedown)
```
## Table
```{r tab.cap="caption 1", tab.id="mtcars"}
#head(mtcars) ### produces error
#head(data.frame(x=1:10,y=LETTERS[1:10])) ### produces error
head(1:10) ### runs ok
```
The original code has some table of contents and some sections that compile ok when on their own. Issues start with their Tables section. Example code has the head(mtcars) line: doesn't work, then I tried to simplify it first by taking out the dependency to cars with a simple data.frame: doesn't work. When I simplify to a vector, then it works and produces word document(!?).
I'm thinking it should be a silly thing on my part, but cannot nail it.
Any help?
rmarkdown::render full output:
processing file: minimal_word2.Rmd
|......... | 12%
ordinary text without R code
|.................. | 25%
label: setup (with options)
List of 1
$ include: logi FALSE
|.......................... | 38%
ordinary text without R code
|................................... | 50%
label: unnamed-chunk-1 (with options)
List of 2
$ tab.cap: chr "caption 1"
$ tab.id : chr "mtcars"
|............................................ | 62%
ordinary text without R code
|.................................................... | 75%
label: unnamed-chunk-2 (with options)
List of 1
$ fig.cap: chr "figure caption"
Quitting from lines 23-24 (minimal_word2.Rmd)
Error: read_docx only support docx files
and sessionInfo():
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Mexico.1252 LC_CTYPE=Spanish_Mexico.1252 LC_MONETARY=Spanish_Mexico.1252
[4] LC_NUMERIC=C LC_TIME=Spanish_Mexico.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] officer_0.3.12 officedown_0.2.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 digest_0.6.25 R6_2.4.1 magrittr_1.5 evaluate_0.14
[6] zip_2.0.4 gdtools_0.2.2 rlang_0.4.6 uuid_0.1-4 xml2_1.3.2
[11] rmarkdown_2.3 tools_3.6.3 xfun_0.15 yaml_2.2.1 compiler_3.6.3
[16] systemfonts_0.2.3 rvg_0.2.5 memoise_1.1.0 htmltools_0.5.0 knitr_1.29