-
Notifications
You must be signed in to change notification settings - Fork 1
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
Save sina-plot .rds files #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for a user to save both types of files?
R/plot_cluster_sina.R
Outdated
|
||
file_path <- file.path(output_dir, glue::glue("sina-{varx}.{output_format}")) | ||
|
||
if (output_format == "rds") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this allow saving both as an rds and as an html?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Maybe not yet. If they have produced a cluster-sina ggplot object, then they can save that as an .rds or an .html by calling save_sina_plot(ggobj, ..., output_format = "rds")
or save_sina_plot(ggobj, ..., output_format = "html")
.
But a typical user would be calling the treeview()
workflow, rather than the internals. I can add a sina_output_format
parameter to treeview()
so that they can call treeview(input_env_rds, sina_output_format = "rds")
or treeview(input_env_rds, sina_output_format = "html")
.
Will do that now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my misunderstanding. As both "html" and "rds" in the same runthrough? That isn't implemented here, but can easily be done. Give me a minute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been rewritten. Now the user can save cluster-sina plots as either .rds, .html or both (default: both). And they can specify which format to output the cluster-sina plots in the arguments to treeview()
.
So treeview(input_env_rds)
will output both .rds and .html versions of sina-logistic_growth_rate
and sina-clock_outlier
to "./treeview/".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix: #15
Allows cluster sina plots to be exported as an .Rds file containing a ggplot2 object.
Adds a new function that saves sina plots to file (simplifying the
plot_cluster_sina
function, which now only creates the ggplot object)..That function has an
output_format
parameter defining whether a .rds file (cont. ggplot2 object) or a .html file (cont. htmlwidget) is saved.The main
treeview
function saves ggplot2 objects. These will be converted to interactive plots in tfpbrowser.