Convenient wrapper around a variety of scatterplot functionalities. See details for more.

plotScatterplot(
  object,
  variable_x,
  variable_y,
  phase = NULL,
  across = NULL,
  across_subset = NULL,
  relevel = TRUE,
  ncol = NULL,
  nrow = NULL,
  color_aes = NULL,
  color_by = NULL,
  scales = "fixed",
  space = "fixed",
  pt_alpha = 0.9,
  pt_clr = NULL,
  pt_clrp = NULL,
  pt_fill = NULL,
  pt_shape = NULL,
  pt_size = NULL,
  display_smooth = FALSE,
  smooth_alpha = NULL,
  smooth_clr = NULL,
  smooth_method = NULL,
  smooth_se = NULL,
  smooth_size = NULL,
  display_corr = FALSE,
  corr_method = "pearson",
  corr_pmin = 5e-05,
  corr_pos_x = NULL,
  corr_pos_y = NULL,
  corr_text_sep = "\n",
  corr_text_size = 1,
  ...
)

Arguments

object

A valid cypro object.

variable_x, variable_y

Character values. The numeric variables to be plotted on the x-axis and y-axis. Use getNumericVariableNames() to obtain all valid input options.

phase

Character or numeric. If character, the ordinal value referring to the phase of interest (e.g. 'first', 'second' etc.). referring to the phase of interest or 'all'. If numeric, the number referring to the phase.

If set to NULL takes the phase denoted as default with adjustDefault().

Ignored if the experiment design contains only one phase.

across

Character value, character vector or NULL (see details for more). Specifies the grouping variable of interest.

Use getGroupingVariableNames() to obtain all variable names that group the cells of your experiment in a certain manner.

across_subset

Character vector or NULL. Specifies the particular groups of interest the grouping variable specified in argument across contains.

If set to NULL all of them are chosen. You can prefix groups you are NOT interested in with a '-'. (Saves writing if there are more groups you are interested in than groups you are not interested in.)

Use getGroupNames() to obtain all valid input options.

relevel

Logical value. If set to TRUE the input order of across_subset determines the order in which the groups of interest are displayed. Groups that are not included are dropped which affects the choice of color.

ncol

Given to ggplot2::facet_wrap(). Affects the way the subplots are displayed.

nrow

Given to ggplot2::facet_wrap(). Affects the way the subplots are displayed.

scales

Given to ggplot2::facet_wrap(). Affects the way the subplots are displayed.

space

Given to ggplot2::facet_wrap(). Affects the way the subplots are displayed.

pt_alpha

Numeric value. Specifies the degree of transparency of all points.

pt_clr

Character value. Specifies the color of all points.

pt_clrp

The color palette to be used if the specified variable displayed by color is categorical/discrete. Run validColorPalettes() to see valid input.

pt_size

Numeric value. Specifies the size of all points.

display_smooth

Logical value. If set to TRUE a smoothed line is displayed to emphasize the overall trend of the data. Use the smooth_* arguments to additionally adjust they way the trend is plotted.

smooth_clr

Character value. Denotes the color of the smoothed line.

smooth_method

Character value. Denotes the model type used to display the line. Defaults to 'lm' (linear model). Given to argument method of function ggplot2::geom_smooth().

smooth_se

Logical. If set to TRUE the standard error will be displayed.

smooth_size

Numeric value. Denotes the size of the smoothed line.

display_corr

Logical value. If set to TRUE the correlation of the x- and y-variable is calculated and displayed on the plot (or each subplot if across is specified.)

corr_method

Character value. Denotes the method with which to compute the correlation values if display_corr is set to TRUE. Defaults to 'pearson'.

corr_pmin

Numeric value. The minimum p-value that is displayed as a number. Everything below it is displayed as < corr_pmin.

corr_pos_x, corr_pos_y

Numeric values or NULL. Specify the exact position of the text used to display the correlation results. If set to NULL defaults to left upper corner of the plot.

corr_text_sep

Character value. The string that separates correlation value and respective p-value.

corr_text_size

Numeric value. The size used to print the correlation results.

Value

A ggplot.

Details

Argument across can be specified as a character vector of length 2. If so, argument across_subset must be a list of character vectors whereby the names of the list correspond to the input for across.