flow icon indicating copy to clipboard operation
flow copied to clipboard

flow_doc rendering error

Open azzaea opened this issue 4 years ago • 4 comments

Hello,

Thank you for the great package- quite handy! I'm using flow_0.0.2, and flow_doc function always fails with the error:

> flowdoc(pkg = "mypackage", narrow = T)
:
:
:
File exp_1.png not found in resource path
Error: pandoc document conversion failed with error 99

With a bit of debugging, this error happens towards the end of flow_doc when pandoc is called- specifically, at this linke

rmarkdown::render(rmd_output, output_file = out)

From here, pandoc error 99 suggests the *.md file and images generated during the flow_doc function call are in different directories. In fact, there are no *.png files there, but rather, separate directories for each function with js code inside. This is how my temp folder looks like:

$ pwd
/tmp/Rtmp8ooCHS
Rtmp8ooCHS$ tree
.
├── file45f12153977.html
├── file45f1c11fd9a.html
├── file45f1c4382ca.html
├── flow_45f12eb869f_files
│   ├── es6shim-0.35.6
│   │   └── es6shim.js
│   ├── es7shim-6.0.0
│   │   └── es7shim.js
│   ├── graphre-0.1.3
│   │   └── graphre.js
│   ├── htmlwidgets-1.5.3
│   │   └── htmlwidgets.js
│   ├── nomnoml-1.3.1
│   │   └── nomnoml.js
│   └── nomnoml-binding-0.2.3
│       └── nomnoml.js
├── flow_45f12eb869f.html
├── flow_45fdeaac9a.html
└── mypackage
    └── test.Rmd

Which actually supports this suggestion. Would you give it a look?

Thank you again for quite a handy package!

Azza

azzaea avatar Apr 21 '21 17:04 azzaea

Thanks so much for the feedback. For some reason I've missed the notification and submitted the package without seeing it, I hope it will be refused so I can fix this fast! In any case I'll take a look ASAP.

moodymudskipper avatar Apr 24 '21 23:04 moodymudskipper

Could you please install the latest version ? I've tested it on my side and it works. So the issue might be one of the following :

  • Something I've solved in the last few days and your version predates this
  • Related to the system (I use windows, so please share your session info if it still fails)
  • Related to the package that you're documenting (so please share a package that triggers the failure too)

Thanks!

moodymudskipper avatar Apr 25 '21 07:04 moodymudskipper

Apologies for the delay in responding, I couldn't access the previous machine since then, so tried to replicate in a different one. I'm afraid the issue still persists.

I was running on Ubuntu 16 before, but this one is Ubuntu 20. In both machines, it is the same problem regardless of the package specified (I tried assertthat from CRAN, flow from github, and pcgen2 available on my machine)- below is an example.

> library(flow)
> flow_doc(pkg = "pcgen2", narrow = T)
Building diagrams of exported functions
==================================================================================================
Building diagrams of unexported functions
==================================================================================================
knitting

processing file: test.Rmd
  |........................................................................................| 100%
  ordinary text without R code


output file: test.knit.md

/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS test.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output /tmp/RtmpvCQ0tT/filebd8654bf624e.html --lua-filter /home/azza/R/x86_64-pc-linux-gnu-library/4.0/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /home/azza/R/x86_64-pc-linux-gnu-library/4.0/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --standalone --section-divs --table-of-contents --toc-depth 3 --variable toc_float=1 --variable toc_selectors=h1,h2,h3 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --variable toc_print=1 --template /home/azza/R/x86_64-pc-linux-gnu-library/4.0/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --include-in-header /tmp/RtmpvCQ0tT/rmarkdown-strbd8650564881.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' 
File exp_1.png not found in resource path
Error: pandoc document conversion failed with error 99

So, pandoc does not find those png files containing the needed diagrams (I checked by inspecting the specified directory, /tmp/RtmpvCQ0tT and there are indeed only *html and *js files similar the original ticket).

For completion, here are the session info.

Many due thanks for your help and looking into this.

> sessioninfo::session_info()
─ Session info ─────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.0.5 (2021-03-31)
 os       Ubuntu 20.04.2 LTS          
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Europe/Amsterdam            
 date     2021-05-13                  

─ Packages ─────────────────────────────────────────────────────────────────────────────────────
 package      * version    date       lib source                               
 abind          1.4-5      2016-07-21 [1] CRAN (R 4.0.5)                       
 assertthat     0.2.1      2019-03-21 [1] CRAN (R 4.0.5)                       
 backports      1.2.1      2020-12-09 [1] CRAN (R 4.0.5)                       
 base64enc      0.1-3      2015-07-28 [1] CRAN (R 4.0.5)                       
 bdsmatrix      1.3-4      2020-01-13 [1] CRAN (R 4.0.5)                       
 BiocGenerics   0.36.1     2021-04-16 [1] Bioconductor                         
 boot           1.3-28     2021-05-03 [4] CRAN (R 4.0.5)                       
 cachem         1.0.4      2021-02-13 [1] CRAN (R 4.0.5)                       
 callr          3.7.0      2021-04-20 [1] CRAN (R 4.0.5)                       
 checkmate      2.0.0      2020-02-06 [1] CRAN (R 4.0.5)                       
 cli            2.5.0      2021-04-26 [1] CRAN (R 4.0.5)                       
 clue           0.3-59     2021-04-16 [1] CRAN (R 4.0.5)                       
 cluster        2.1.2      2021-04-17 [4] CRAN (R 4.0.5)                       
 colorspace     2.0-0      2020-11-11 [1] CRAN (R 4.0.5)                       
 corpcor        1.6.9      2017-04-01 [1] CRAN (R 4.0.5)                       
 crayon         1.4.1      2021-02-08 [1] CRAN (R 4.0.5)                       
 data.table     1.14.0     2021-02-21 [1] CRAN (R 4.0.5)                       
 DBI            1.1.1      2021-01-15 [1] CRAN (R 4.0.5)                       
 DEoptimR       1.0-8      2016-11-19 [1] CRAN (R 4.0.5)                       
 desc           1.3.0      2021-03-05 [1] CRAN (R 4.0.5)                       
 devtools     * 2.4.1      2021-05-05 [1] CRAN (R 4.0.5)                       
 digest         0.6.27     2020-10-24 [1] CRAN (R 4.0.5)                       
 dplyr          1.0.5      2021-03-05 [1] CRAN (R 4.0.5)                       
 ellipsis       0.3.2      2021-04-29 [1] CRAN (R 4.0.5)                       
 evaluate       0.14       2019-05-28 [1] CRAN (R 4.0.5)                       
 fansi          0.4.2      2021-01-15 [1] CRAN (R 4.0.5)                       
 fastICA        1.2-2      2019-07-08 [1] CRAN (R 4.0.5)                       
 fastmap        1.1.0      2021-01-25 [1] CRAN (R 4.0.5)                       
 flow         * 0.0.2      2021-05-13 [1] Github (moodymudskipper/flow@b22731a)
 foreign        0.8-81     2020-12-22 [4] CRAN (R 4.0.3)                       
 Formula        1.2-4      2020-10-16 [1] CRAN (R 4.0.5)                       
 fs             1.5.0      2020-07-31 [1] CRAN (R 4.0.5)                       
 generics       0.1.0      2020-10-31 [1] CRAN (R 4.0.5)                       
 ggm            2.5        2020-02-16 [1] CRAN (R 4.0.5)                       
 ggplot2        3.3.3      2020-12-30 [1] CRAN (R 4.0.5)                       
 glue           1.4.2      2020-08-27 [1] CRAN (R 4.0.5)                       
 graph          1.68.0     2020-10-27 [1] Bioconductor                         
 gridExtra      2.3        2017-09-09 [1] CRAN (R 4.0.5)                       
 gtable         0.3.0      2019-03-25 [1] CRAN (R 4.0.5)                       
 Hmisc          4.5-0      2021-02-28 [1] CRAN (R 4.0.5)                       
 htmlTable      2.1.0      2020-09-16 [1] CRAN (R 4.0.5)                       
 htmltools      0.5.1.1    2021-01-22 [1] CRAN (R 4.0.5)                       
 htmlwidgets    1.5.3      2020-12-10 [1] CRAN (R 4.0.5)                       
 igraph         1.2.6      2020-10-06 [1] CRAN (R 4.0.5)                       
 jpeg           0.1-8.1    2019-10-24 [1] CRAN (R 4.0.5)                       
 jsonlite       1.7.2      2020-12-09 [1] CRAN (R 4.0.5)                       
 knitr          1.32       2021-04-14 [1] CRAN (R 4.0.5)                       
 lattice        0.20-44    2021-05-02 [4] CRAN (R 4.0.5)                       
 latticeExtra   0.6-29     2019-12-19 [1] CRAN (R 4.0.5)                       
 lifecycle      1.0.0      2021-02-15 [1] CRAN (R 4.0.5)                       
 lme4           1.1-26     2020-12-01 [1] CRAN (R 4.0.5)                       
 magrittr       2.0.1      2020-11-17 [1] CRAN (R 4.0.5)                       
 MASS           7.3-54     2021-05-03 [4] CRAN (R 4.0.5)                       
 Matrix         1.3-3      2021-05-04 [4] CRAN (R 4.0.5)                       
 memoise        2.0.0      2021-01-26 [1] CRAN (R 4.0.5)                       
 minqa          1.2.4      2014-10-09 [1] CRAN (R 4.0.5)                       
 munsell        0.5.0      2018-06-12 [1] CRAN (R 4.0.5)                       
 nlme           3.1-152    2021-02-04 [4] CRAN (R 4.0.3)                       
 nloptr         1.2.2.2    2020-07-02 [1] CRAN (R 4.0.5)                       
 nnet           7.3-16     2021-05-03 [4] CRAN (R 4.0.5)                       
 nomnoml        0.2.3      2020-12-15 [1] CRAN (R 4.0.5)                       
 pcalg          2.7-2      2021-04-22 [1] CRAN (R 4.0.5)                       
 pcgen2         0.2.0.9999 2021-04-30 [1] local                                
 pillar         1.6.0      2021-04-13 [1] CRAN (R 4.0.5)                       
 pkgbuild       1.2.0      2020-12-15 [1] CRAN (R 4.0.5)                       
 pkgconfig      2.0.3      2019-09-22 [1] CRAN (R 4.0.5)                       
 pkgload        1.2.1      2021-04-06 [1] CRAN (R 4.0.5)                       
 png            0.1-7      2013-12-03 [1] CRAN (R 4.0.5)                       
 prettyunits    1.1.1      2020-01-24 [1] CRAN (R 4.0.5)                       
 processx       3.5.2      2021-04-30 [1] CRAN (R 4.0.5)                       
 ps             1.6.0      2021-02-28 [1] CRAN (R 4.0.5)                       
 purrr          0.3.4      2020-04-17 [1] CRAN (R 4.0.5)                       
 R.cache        0.15.0     2021-04-30 [1] CRAN (R 4.0.5)                       
 R.methodsS3    1.8.1      2020-08-26 [1] CRAN (R 4.0.5)                       
 R.oo           1.24.0     2020-08-26 [1] CRAN (R 4.0.5)                       
 R.utils        2.10.1     2020-08-26 [1] CRAN (R 4.0.5)                       
 R6             2.5.0      2020-10-28 [1] CRAN (R 4.0.5)                       
 RBGL           1.66.0     2020-10-27 [1] Bioconductor                         
 RColorBrewer   1.1-2      2014-12-07 [1] CRAN (R 4.0.5)                       
 Rcpp           1.0.6      2021-01-15 [1] CRAN (R 4.0.5)                       
 remotes        2.3.0      2021-04-01 [1] CRAN (R 4.0.5)                       
 rlang          0.4.11     2021-04-30 [1] CRAN (R 4.0.5)                       
 rmarkdown      2.7        2021-02-19 [1] CRAN (R 4.0.5)                       
 robustbase     0.93-7     2021-01-04 [1] CRAN (R 4.0.5)                       
 rpart          4.1-15     2019-04-12 [4] CRAN (R 4.0.0)                       
 rprojroot      2.0.2      2020-11-15 [1] CRAN (R 4.0.5)                       
 rstudioapi     0.13       2020-11-12 [1] CRAN (R 4.0.5)                       
 scales         1.1.1      2020-05-11 [1] CRAN (R 4.0.5)                       
 sessioninfo    1.1.1      2018-11-05 [1] CRAN (R 4.0.5)                       
 sfsmisc        1.1-11     2021-04-12 [1] CRAN (R 4.0.5)                       
 sommer         4.1.3      2021-04-05 [1] CRAN (R 4.0.5)                       
 statmod        1.4.35     2020-10-19 [1] CRAN (R 4.0.5)                       
 stringi        1.5.3      2020-09-09 [1] CRAN (R 4.0.5)                       
 stringr        1.4.0      2019-02-10 [1] CRAN (R 4.0.5)                       
 styler         1.4.1      2021-03-30 [1] CRAN (R 4.0.5)                       
 survival       3.2-11     2021-04-26 [4] CRAN (R 4.0.5)                       
 testthat       3.0.2      2021-02-14 [1] CRAN (R 4.0.5)                       
 tibble         3.1.1      2021-04-18 [1] CRAN (R 4.0.5)                       
 tidyselect     1.1.0      2020-05-11 [1] CRAN (R 4.0.5)                       
 tinytex        0.31       2021-03-30 [1] CRAN (R 4.0.5)                       
 usethis      * 2.0.1      2021-02-10 [1] CRAN (R 4.0.5)                       
 utf8           1.2.1      2021-03-12 [1] CRAN (R 4.0.5)                       
 vctrs          0.3.8      2021-04-29 [1] CRAN (R 4.0.5)                       
 webshot        0.5.2      2019-11-22 [1] CRAN (R 4.0.5)                       
 withr          2.4.2      2021-04-18 [1] CRAN (R 4.0.5)                       
 xfun           0.22       2021-03-11 [1] CRAN (R 4.0.5)                       
 yaml           2.2.1      2020-02-01 [1] CRAN (R 4.0.5)                       

[1] /home/azza/R/x86_64-pc-linux-gnu-library/4.0
[2] /usr/local/lib/R/site-library
[3] /usr/lib/R/site-library
[4] /usr/lib/R/library

azzaea avatar May 13 '21 13:05 azzaea

Thanks a lot Azza I will look into it

moodymudskipper avatar May 13 '21 14:05 moodymudskipper