You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Markdown
```{r, dependson = file.info("test.rmd")}
# Need `cache.extra =`, not `dependson =` here
# Note: need name of a file that actually exists
"hi there!"
```
(I call this file test.rmd and compile as
$ Rscript -e "knitr::knit('test.rmd')"
)
Unfortunately, knitr gives an incomprehensible error message:
processing file: test.rmd
Error in defaults[[name]] : subscript out of bounds
Calls: <Anonymous> ... get -> setNames -> resolve -> setNames -> <Anonymous>
Execution halted
I'd expect a message along the lines
Processing code chunk 1... Invalid chunk name for 'dependson' option at line 3.
(This seems only to happen if the file.info refers to an existing file, not to a non-existing file.)
I have provided the necessary information about my issue.
If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/knitr').
If I have posted the same issue elsewhere, I have also mentioned it in this issue.
I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion! Invalid dependson values will no longer trigger an error, and a warning message will be issued.
Accidentally, dependson = file.info("test.rmd") will work fine, even though you meant to use cache.extra (the chunk option name doesn't matter; it's the value that matters for caching).
I (mistakenly) write a code chunk like
(I call this file test.rmd and compile as
)
Unfortunately, knitr gives an incomprehensible error message:
I'd expect a message along the lines
(This seems only to happen if the file.info refers to an existing file, not to a non-existing file.)
Session info:
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: