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

purl with output specified does not work if <documentName>.R exists #970

Closed
dtenenba opened this issue Mar 11, 2015 · 3 comments
Closed
Labels
bug Bugs
Milestone

Comments

@dtenenba
Copy link

Say I have a document called test.Rnw. If I purl it and specify the output as "myoutput", it works. However...if I had not specified the output, it would have written to test.R. If test.R exists, purl will not work when I once again run it specifying output='myfile'. See below:

> library(knitr)
> cat("<<>>=\nls()\n@\n", file="test.Rnw")
> purl("test.Rnw", output="myoutput")


processing file: test.Rnw
  |.................................................................| 100%
output file: myoutput

[1] "myoutput"
> file.exists("myoutput")
[1] TRUE
> file.remove("myoutput")
[1] TRUE
> file.create("test.R")
[1] TRUE
> purl("test.Rnw", output="myoutput")
[1] "test.R"
> file.exists("myoutput")
[1] FALSE
> file.info("test.R")$size
[1] 0

Note that the second call to purl() returns "test.R", however, test.R is still empty after the code above has run. And myoutput does not exist.

> sessionInfo()
R Under development (unstable) (2015-02-08 r67773)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitr_1.9

loaded via a namespace (and not attached):
[1] formatR_1.0    tools_3.2.0    stringr_0.6.2  evaluate_0.5.5
@yihui yihui closed this as completed in 54f5aaa Mar 12, 2015
@yihui yihui added this to the v1.10 milestone Mar 12, 2015
@yihui yihui added the bug Bugs label Mar 12, 2015
@yihui
Copy link
Owner

yihui commented Mar 12, 2015

Should be fixed now. Thanks!

@dtenenba
Copy link
Author

Thanks for the fix!

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs
Projects
None yet
Development

No branches or pull requests

2 participants