Description Usage Arguments Value Note
Takes a ggplot2 object and overlays points from a reference. The function uses the mapping and plot environment from a previous ggplot to add an overlay with a matching 'reference' data.frame. This yields a new plot with items that intersect the the original ggplot data and the reference data. Can be applied iteratively. The user can input certain columns in the reference to gain more control over the plotting parameters of individual points. See notes for additional details.
1 2 3 4 5 6 7 8 9 10 11 | plot_overlay(
p,
reference,
match = "gene",
label = NULL,
label.size = NULL,
label.color = "black",
label.box.padding = 0.3,
label.point.padding = 0.5,
label.arrowhead.size = 0.01
)
|
p |
A ggplot object. Usually passed down from |
reference |
a list of data.frames that are preferably named. The name of the list will passed down to the data.frame as the column 'dataset'. Alternatively, the dataset can have a column name dataset. |
match |
by what string should the ggplot and overlay be merged? Default is 'gene'. |
label |
A boolean. This will overwrite the |
label.size |
numeric. Size of label. This will overwrite the |
label.color |
the color of the label. Default is black. |
label.box.padding |
Amount of padding around bounding box. See |
label.point.padding |
Amount of padding around label. See |
label.arrowhead.size |
The size of the arrowhead. 0 means no arrowhead. |
a ggplot
The following data.frame headers for a reference are accepted:
"gene" A string tht indicates the gene name.
"label" A boolen that indicates whether the label should be plotted.
"label_size"A numeric that indicates the size of the label items.
See ?validate_reference or additional details.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.