Description Usage Arguments Details Value See Also Examples
Save data in RDS file for debug if on_debug()
is TRUE.
1 | save_debug_data(data, output_file, overwrite = FALSE)
|
data |
A R obj to save. |
output_file |
A character of name of output file |
overwrite |
A logical to overwrite existed output_file or not. Default FALSE means not to overwrite existed output file. |
If on_debug() is TRUE, save_debug_data will save data and return the path of saved file, otherwise it will save nothing and return NULL.
The saved data is located in app/temp directory with name like "outputfile_(YYYY-MM-DD).RDS". It will overwrite existed file if overwrite is TRUE, otherwise it will create a new file with a name with serial numbers, like "outputfile_(YYYY-MM-DD)_1.RDS".
A character of path of output file saved or NULL.
Other utils_dev:
add_analysis_module()
,
add_shiny_module()
,
debug_mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
# Step1, put save_debug_data() at lines where to save data for debug
result <- foo()
save_debug_data(result, output_file = "result_data")
# Step2, activate debug mode if you want to store data for debug
enable_debug()
# Step3, deactivate debug mode if you want run app normally
disable_debug()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.