When I save my R notebook file, I believe the file is being processed in the background, executing the full notebook beginning to end?
I understand this is beneficial from a 'my_file.html output is always up to date' perspective, however, if their is heavy duty, long processing code in the file, I may not actually want to run the 'expensive parts' of the code:
1: my working space in memory has the model already
2: my changes do not invalidate that work, it may just be tweaking a graph output
3: I want to save my changes for the purposes of version control, my html output is not important to me at that moment
Is it possible to prevent this double execution problem through a setting or parameter?
The solution offered in this StackOverflow post is to change the output format of the document within your YAML metadata.
For example, currently you might have something like
output: html_notebook
which is what causes the document to be rendered on save. Changing it to html_document or just deleting it should stop the document from rendering on save.
Thanks, this is far neater than I expected. I had always just assumed (obviously wrongly) without that yaml argument the save would error (like if you have chunks named the same)!