View source: R/save_dye_screen_figs.R
make_figure_title | R Documentation |
A helper function of limited scope and flexibility. Given a dataframe, extracts values from specified columns and assembles them into titles and names. Exported only because it can be useful for general workflows as well. Generates experiment-specific names, of the format: Experiment_number (linebreak) Protein: protein name (linebreak) Buffer: buffer name Defaults to creating a title of the form: And a name of the form: <Experiment_number>protein_<protein_name>buffer_<buffer_name>
make_figure_title(
df,
.exp_num_col = "exp_num",
.prot_name_col = "identity",
.override_names = FALSE,
.manual_exp_num = Sys.Date(),
.manual_prot_name = "screened protein",
.manual_buffer_name = "screening buffer",
.type_col = "type",
...
)
df |
a df, e.g. one created by the |
.exp_num_col |
a string, giving the name of the column whose value will appear first in the titles/names. Defaults to "exp_num", which, if the dataframe comes from the |
.prot_name_col |
a string, giving the name of the column whose value will appear second in the titles/names. Defaults to "identity", which, if the dataframe comes from the |
.override_names |
a boolean, which, if TRUE, overrides the names extracted from ..exp_num_col and .prot_name_col within the function, with the strings provided to the following arguments of this function. Defaults to FALSE. |
.manual_exp_num |
a string, which, if .override_names is set to TRUE, is used as the first element of both plot title and saved name. |
.manual_prot_name |
a string, which, if .override_names is set to TRUE, is used as the second element of both plot title and saved name, where the name of the protein typically appears. |
.manual_buffer_name |
a string, which, if .override_names is set to TRUE, is used as the third element of both plot title and saved name, where the name of the buffer typically appears. |
.type_col |
the name of the column which contains values of either "protein" or "buffer", which can be used to filter the input dataframe such that a single, unique name can be pulled from the .prot_name_col column for the protein (when filtered such that .type_col == "protein), or buffer (when filtered such that .type_col == "buffer"). |
... |
tolerate unmatched arguments passed via .. from upstream functions; ignore if they don't match anything in this function |
a names list with two named elements: "print" – the name to be printed at the head of the plot, and "save" – the name to be used to save the plot via ggsave. Additional elements can be appended to the save name in the saving functions, to specify which figure is being saved when more than one figure is saved for the same experiment. Specific paths to save to are also set in the save_* plot functions of this package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.