Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdblischak/wflow-build-undefined-variable
Reproducible example of unexpected wflow_build behavior
https://github.com/jdblischak/wflow-build-undefined-variable
Last synced: 20 days ago
JSON representation
Reproducible example of unexpected wflow_build behavior
- Host: GitHub
- URL: https://github.com/jdblischak/wflow-build-undefined-variable
- Owner: jdblischak
- Created: 2017-11-16T22:32:05.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-16T23:05:10.000Z (about 7 years ago)
- Last Synced: 2024-10-15T23:55:26.698Z (2 months ago)
- Language: HTML
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# undefined
This repository reproduces a strange observation with the function `wflow_build()` of the [workflowr][] R package.
## Description
If a function in a package has an undefined variable, and that variable is
defined in one of the enclosing environments, it will used that variable. In
general this is probably a bad idea, but if the purpose of the function is to
react to the current environment in some way, this may be desired behavior.This works when using the "Knit" button in RStudio, `rmarkdown::render_site`,
and `rmarkdown::render`. However, `wflow_build`, which calls
`rmarkdown::render_site` via `callr::r_safe` does not allow this.## Instructions
1. Clone this repo
1. Install workflowr
1. Build and install the package `undefined` with `devtools::install` (or Ctrl-Shift-B in RStudio)
1. Open `analysis/undefined.Rmd` and run with RStudio "Knit" button (or `rmarkdown::render_site("analysis/undefined.Rmd")`)
1. Run `workflowr::wflow_build("analysis/undefined.Rmd")`To clean up, remove the fake package with `remove.packages("undefined")`
[workflowr]: https://github.com/jdblischak/workflowr