You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sjPlot::tab_model() function has a file parameter that allows you to save a nice .html table of your model results. But when running it inside a {targets} pipeline, the file parameter is ignored and no file is saved.
The saving behavior is triggered when we do tar_read(table_save) or tar_load(table_save); table_save.
I would expect the file to be created when running the pipeline with tar_make() with no further steps.
Please, let me know if you think I should report this in the {sjPlot} package instead of here.
Below a reproducible example. Given it involves creating files, I could not manage to do a proper reprex.
Reproducible example
This is the standard (expected) behavior for the table_save target. You input a model, and if the file parameter is there, it creates a file:
Oddly enough, sjPlot::tab_model() does not actually write a file. Instead, it returns an sjPlot object whose print() method actually does the writing. When the table runs in a target, it skips the interactive print-out and thus no file is written.
Personally, I find this behavior misleading and recommend filing an issue in the sjPlot package.
As a workaround, you can call the print method yourself in the target. If you want the file, I also recommend setting format = "file" so the output file is tracked for changes and automatically rebuilt if corrupted.
Prework
targets
and not a known limitation or usage error.Description
The sjPlot::tab_model() function has a
file
parameter that allows you to save a nice .html table of your model results. But when running it inside a {targets} pipeline, thefile
parameter is ignored and no file is saved.The saving behavior is triggered when we do
tar_read(table_save)
ortar_load(table_save); table_save
.I would expect the file to be created when running the pipeline with
tar_make()
with no further steps.Please, let me know if you think I should report this in the {sjPlot} package instead of here.
Below a reproducible example. Given it involves creating files, I could not manage to do a proper reprex.
Reproducible example
This is the standard (expected) behavior for the table_save target. You input a model, and if the file parameter is there, it creates a file:
But if the sjPlot::tab_model(model, file = "TABLE_targets.html") code runs inside {targets}, the file parameter is ignored.
But, if we take a look, the file is created
Also, if we read it, it is saved
Diagnostic information
The text was updated successfully, but these errors were encountered: