Nested child documents requires full path when using flexdashboard and runtime set to shiny.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the failure with index.Rmd, child.Rmd, and grandchild.Rmd using flexdashboard with runtime: shiny, then compare it with ordinary R Markdown and the full-path workaround. Start from the discover_rmd_resources and copy_render_intermediates calls in the reported stack trace. Done means nested child documents resolve by relative path and the dashboard renders successfully.
Written by the indexing model from the issue text.
Description
Hi,
first of all thanks a lot for making flexdashboard it makes creating Shiny apps a breeze!
I have a project made of index.Rmd, child.Rmd and grandchild.Rmd (in the same directory).
index.Rmd contains:
---
title: "Dashboard"
output:
flexdashboard::flex_dashboard:
vertical_layout: fill
runtime: shiny
---
#Master
Row
------------------------
```{r child='child.Rmd'}
```
child.Rmd contains:
Row
-------------------------
Child.
```{r child='grandchild.Rmd'}
```
and grandchild.Rmd contains:
Row
-------------------------
Grandchild here.
When trying to compile index.Rmd (CTRL+SHIFT+K in RStudio Server) the compilation fails with error (in the Rmarkdown tab in RStudio):
Warning in readLines(if (is.character(input2)) { :
cannot open file '/tmp/RtmphJxTx3/grandchild.Rmd': No such file or directory
Quitting from lines 7-7 (/tmp/RtmphJxTx3/grandchild.Rmd)
Quitting from lines 7-7 (/tmp/RtmphJxTx3/grandchild.Rmd)
Warning: Error in readLines: cannot open the connection
Stack trace (innermost first):
119: readLines
118: knit
117: FUN
116: lapply
115: process_tangle.block
114: process_tangle
113: withCallingHandlers
112: process_file
111: knit
110: FUN
109: lapply
108: process_tangle.block
107: process_tangle
106: withCallingHandlers
105: process_file
104: knit
103: knitr::purl
102: discover_rmd_resources
101: find_external_resources
100: copy_render_intermediates
99: output_format$intermediates_generator
98:
97: do.call
96: contextFunc
95: .getReactiveEnvironment()$runWith
94: shiny::maskReactiveContext
93:
82: doc
81: shiny::renderUI
80: func
79: origRenderFunc
78: output$reactivedoc
3:
2: do.call
1: rmarkdown::run
If you change child.Rmd to use the full path to grandchild.Rmd
Row
-------------------------
Child.
```{r child='/home/luca/sandbox/rmarkdown_grandchildren/grandchild.Rmd'}
```
then the dashboard is created without problems.
Initially I thought the problem was with knitr (I even reported a bug there that I closed https://github.com/yihui/knitr/issues/1434) but then I realized that the problem only arise when I use
flexdashboard and runtime: shiny (if you remove runtime: shiny from index.Rmd the dashboard compiles, but of course you can't use Shiny control anymore, which makes using flexdashboard quite pointless).
In normal Rmarkdown (to make html documents for example) you can nest grandchild.Rmd without having to specify the full path, which is why I think this behaviour in flexdashboard is a bug.
Cheers,
Luca
P.s. this is the output of sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8
[8] LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=Cattached base packages:
[1] stats graphics grDevices utils datasets methods baseloaded via a namespace (and not attached):
[1] backports_1.0.5 magrittr_1.5 rprojroot_1.2 htmltools_0.3.5 tools_3.3.3 flexdashboard_0.5 yaml_2.1.13 Rcpp_0.12.12 stringi_1.1.5 rmarkdown_1.6 knitr_1.17
[12] jsonlite_1.5 stringr_1.2.0 digest_0.6.12 evaluate_0.9
- Dominant language
- JavaScript
- Stars
- 848
- Forks
- 298
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rstudio/flexdashboard
-
rstudio/flexdashboard#462 · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
rstudio/flexdashboard#456 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
rstudio/flexdashboard#453 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
rstudio/flexdashboard#452 · 5 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
rstudio/flexdashboard#449 ·
All issues in rstudio/flexdashboard
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100