Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsconnect::appDependencies evaluates eval parameter in rmarkdown chunks and might produce warnings #459

Closed
dirkschumacher opened this issue Sep 29, 2020 · 3 comments

Comments

@dirkschumacher
Copy link

dirkschumacher commented Sep 29, 2020

Context

I have an rmarkdown file that uses the eval parameters in chunks to control which chunks get evaluated. The idea is for that specific application that the code envoking rmarkdown::render can control what chunks will be evaluated instead of the report itself in order to keep the login in the markdown file as small as possible.

Problem

When rsconnect::appDependencies() is invoked it evaluates the code in each eval parameter and thus producing a warning. These warnings are in particularly genereted during deployments to RStudio Connect. / shinyapps.io. Nothing breaks though.

Reproducible example

Create a file "test.Rmd" with a single chunk

```{r test, eval=show_chunk} 
summary(cars)
```

then:

> rsconnect::appDependencies()
Error in eval(x, envir = envir) : object 'show_chunk' not found

Here is an example of how it is used:

rmarkdown::render("test.Rmd", envir = list(show_chunk = TRUE))
rmarkdown::render("test.Rmd", envir = list(show_chunk = FALSE))

Potential solution

  • One option could be to suppressWarnings when evaluating eval, but this might have other unintented sideeffects.
@dirkschumacher
Copy link
Author

Might be related to #429

@jmcphers
Copy link
Member

Yes, this is likely a side effect of the dependency discovery scan.

Do you see the same error when you run rmarkdown::find_external_resources() on your doc?

@aronatkins
Copy link
Contributor

This problem was caused by using rmarkdown::render to analyze R Markdown files for dependencies.

We believe that this is resolved with rstudio/packrat#647.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants