- data_frame
A data_frame where columns are features and rows are observations you might wish to visualize.
- x.by, y.by
Single strings denoting the name of a column of data_frame containing numeric data to use for the x- and y-axis of the scatterplot.
- color.by
Single string denoting the name of a column of data_frame to use, instead of point density, for setting the color of plotted hexagons.
Alternatively, a string vector naming multiple such columns of data to plot at once.
- bins
Numeric or numeric vector giving the number of hexagonal bins in the x and y directions. Set to 30 by default.
- color.method
Single string that specifies how color.by data should be summarized per each hexagonal bin.
Options, and the default, depend on whether the color.by-data is continuous versus discrete:
Continuous: String naming a function for how target data should be summarized for each bin.
Can be any function that inputs (summarizes) a numeric vector and outputs a single numeric value.
Default is median.
Other useful options are sum, mean, sd, or max.
You can also use a custom function as long as you give it a name; e.g. first run logsum <- function(x) { log(sum(x)) } externally, then give color.method = "logsum".
Discrete: A string signifying whether the color should (default) be simply based on the "max" grouping of the bin,
based on "prop.<value>" the proportion of a specific value (e.g. "prop.A" or "prop.TRUE"),
or based on the "max.prop"ortion of observations belonging to any grouping.
- split.by
1 or 2 strings denoting the name(s) of column(s) of data_frame containing discrete data to use for faceting / separating data points into separate plots.
When 2 columns are named, c(row,col), the first is used as rows and the second is used for columns of the resulting facet grid.
When 1 column is named, shape control can be achieved with split.nrow and split.ncol
- rows.use
String vector of rownames of data_frame OR an integer vector specifying the row-indices of data points which should be plotted.
Alternatively, a Logical vector, the same length as the number of rows in data_frame, where TRUE values indicate which rows to plot.
- color.panel
String vector which sets the colors to draw from when color.by indicates discrete data.
dittoColors() by default, see dittoColors for contents.
A named vector can be used if names are matched to the distinct values of the color.by data.
- colors
Integer vector, the indexes / order, of colors from color.panel to actually use.
Useful for quickly swapping around colors of the default set (when not using names for color matching).
- x.adjustment, y.adjustment, color.adjustment
A recognized string indicating whether numeric x.by, y.by, and color.by data should be used directly (default) or should be adjusted to be
"z-score": scaled with the scale() function to produce a relative-to-mean z-score representation
"relative.to.max": divided by the maximum value to give percent of max values between [0,1]
Ignored if the target data is not numeric as these known adjustments target numeric data only.
In order to leave the unedited data available for use in other features, the adjusted data are put in a new column and that new column is used for plotting.
- x.adj.fxn, y.adj.fxn, color.adj.fxn
If you wish to apply a function to edit the x.by, y.by, or color.by data before use, in a way not possible with the color.adjustment input,
this input can be given a function which takes in a vector of values as input and returns a vector of values of the same length as output.
For example, function(x) {log2(x)} or as.factor.
In order to leave the unedited data available for use in other features, the adjusted data are put in a new column and that new column is used for plotting.
- multivar.split.dir
"row" or "col", sets the direction of faceting used for 'var' values when:
- split.nrow, split.ncol
Integers which set the dimensions of faceting/splitting when faceting by a single feature.
- split.adjust
A named list which allows extra parameters to be pushed through to the faceting function call.
List elements should be valid inputs to the faceting functions, e.g. `list(scales = "free")`.
For options, when giving 1 column to split.by, see facet_wrap,
OR when giving 2 columns to split.by, see facet_grid.
- min.density, max.density
Number which sets the min/max values used for the density scale.
Used no matter whether density is represented through opacity or color.
- min.color, max.color
color for the min/max values of the color scale.
- min.opacity, max.opacity
Scalar between [0,1] which sets the minimum or maximum opacity used for the density legend (when color is used for color.by data and density is shown via opacity).
- min, max
Number which sets the values associated with the minimum or maximum color for color.by data.
- rename.color.groups
String vector which sets new names for the identities of color.by groups.
- xlab, ylab
Strings which set the labels for the axes. To remove, set to NULL.
- main
String, sets the plot title. The default title is either "Density", color.by, or NULL, depending on the identity of color.by.
To remove, set to NULL.
- sub
String, sets the plot subtitle.
- theme
A ggplot theme which will be applied before internal adjustments.
Default = theme_bw().
See https://ggplot2.tidyverse.org/reference/ggtheme.html for other options and ideas.
- do.contour
Logical. Whether density-based contours should be displayed.
- contour.color
String that sets the color of the do.contour contours.
- contour.linetype
String or numeric which sets the type of line used for do.contour contours.
Defaults to "solid", but see linetype for other options.
- do.ellipse
Logical. Whether color.by groups should be surrounded by median-centered ellipses.
- do.label
Logical. Whether to add text labels near the center (median) of color.by groups.
- labels.size
Number which sets the size of labels text when do.label = TRUE.
- labels.highlight
Logical. Whether labels should have a box behind them when do.label = TRUE.
- labels.use.numbers
Logical which controls swapping of data-value-labels for number-labels and adjustment of the legend to provide the mapping.
- labels.numbers.spacer
String. When do.label = TRUE and labels.use.numbers, this string is used in the legend between the numbers and their associated data values.
- labels.repel
Logical, that sets whether the labels' placements will be adjusted with ggrepel to avoid intersections between labels and plot bounds when do.label = TRUE.
TRUE by default.
- labels.split.by
String of one or two column names which controls the facet-split calculations for label placements.
Defaults to split.by, so generally there is no need to adjust this except when if you plan to apply faceting externally.
- labels.repel.adjust
A named list which allows extra parameters to be pushed through to ggrepel function calls.
List elements should be valid inputs to the geom_label_repel by default, or geom_text_repel when labels.highlight = FALSE.
- add.trajectory.by.groups
List of vectors representing trajectory paths, each from start-group to end-group, where vector contents are the group-names indicated by the trajectory.group.by column of data_frame.
- add.trajectory.curves
List of matrices, each representing coordinates for a trajectory path, from start to end, where matrix columns represent x and y coordinates of the paths.
- trajectory.group.by
String denoting the name of a column of data_frame to use for generating trajectories from data point groups.
- trajectory.arrow.size
Number representing the size of trajectory arrows, in inches. Default = 0.15.
- add.xline
Numeric value(s), denoting x-axis value(s), where one or more vertical line(s) should be added.
- xline.linetype
String which sets the type of line for add.xline.
Defaults to "dashed", but any ggplot linetype will work.
- xline.color
String that sets the color(s) of the add.xline line(s). Default = "black".
Alternatively, a vector of strings of the same length as add.xline can be given to set the color of each line individually.
- xline.linewidth
Number that sets the thickness of the add.xline line(s). Default = 0.5.
Alternatively, a vector of numbers of the same length as add.xline can be given to set the thickness of each line individually.
- xline.opacity
Number that sets the opacity of the add.xline line(s). Default = 1.
Alternatively, a vector of numbers of the same length as add.xline can be given to set the opacity of each line individually.
- add.yline
Numeric value(s), denoting y-axis value(s), where one or multiple horizonal line(s) should be added.
- yline.linetype
String which sets the type of line for add.yline.
Defaults to "dashed", but any ggplot linetype will work.
- yline.color
String that sets the color(s) of the add.yline line(s). Default = "black".
Alternatively, a vector of strings of the same length as add.yline can be given to set the color of each line individually.
- yline.linewidth
Number that sets the thickness of the add.yline line(s). Default = 0.5.
Alternatively, a vector of numbers of the same length as add.yline can be given to set the thickness of each line individually.
- yline.opacity
Number that sets the opacity of the add.yline line(s). Default = 1.
Alternatively, a vector of numbers of the same length as add.yline can be given to set the opacity of each line individually.
- add.abline
Numeric value(s), denoting y-axis intercept(s), where one or multiple diagonal line(s) should be added.
Use abline.slope to set slope(s).
- abline.slope
Number that sets the slope of the add.abline line(s). Default = 1.
Alternatively, a vector of numbers of the same length as add.abline can be given to set the slope of each line individually.
- abline.linetype
String which sets the type of line for add.abline.
Defaults to "dashed", but any ggplot linetype will work.
- abline.color
String that sets the color(s) of the add.abline line(s). Default = "black".
Alternatively, a vector of strings of the same length as add.abline can be given to set the color of each line individually.
- abline.linewidth
Number that sets the thickness of the add.abline line(s). Default = 0.5.
Alternatively, a vector of numbers of the same length as add.abline can be given to set the thickness of each line individually.
- abline.opacity
Number that sets the opacity of the add.abline line(s). Default = 1.
Alternatively, a vector of numbers of the same length as add.abline can be given to set the opacity of each line individually.
- legend.show
Logical. Whether any legend should be displayed. Default = TRUE.
- legend.density.title, legend.color.title
Strings which set the title for the legends.
- legend.density.breaks, legend.color.breaks
Numeric vector which sets the discrete values to label in the density and color.by legends.
- legend.density.breaks.labels, legend.color.breaks.labels
String vector, with same length as legend.*.breaks, which sets the labels for the tick marks or hex icons of the associated legend.
- show.grid.lines
Logical which sets whether grid lines should be shown within the plot space.
- data.out
Logical. When set to TRUE, changes the output from the plot alone to a list containing the plot ("plot"),
and data.frame of the underlying data for target observations ("data"),
and the ultimately used mapping of columns to given aesthetic sets, because modification of newly made columns is required for many features ("cols_used").