Skip to contents

Create a QTL bubble plot

Usage

createQtlBubblePlot(
  d,
  x,
  y,
  size,
  group = NULL,
  limits = NULL,
  summarise = FALSE,
  summarize = summarise,
  stat = NULL,
  jitterHeight = 0,
  jitterWidth = NULL,
  showBox = TRUE,
  boxFill = "steelblue2",
  boxColour = boxFill,
  boxColor = boxColour,
  boxAlpha = 0.25,
  boxWidth = 0.5,
  showLegend = TRUE,
  ...
)

Arguments

d

the data frame containing the data to be plotted

x

<data-masked> the column in data that should appear on the x-axis

y

<data-masked> the column in data that should appear on the y-axis

size

<data-masked> the column in data that defines the size of the bubbles

group

<data-masked> Default: NULL the column in data that defines the fill colour of the bubbles

limits

Default: NULL a list defining the characteristics of the horizontal reference lines that should appear on the plot. See Usage notes below.

summarise

Default: FALSE Should the input data frame be summarised to derive the plotted statistics? See Usage notes below

summarize

Default: summarise A US English equivalent to summarise

stat

Default: NULL The summary function to be used to summarise the data. Cannot be NULL if summarise is TRUE. See Usage notes below

jitterHeight

Default: 0. Value of the height parameter in the call to geom_jitter. The default value implies no vertical jittering.

jitterWidth

Default: NULL. Value of the width parameter in the call to geom_jitter. The default value implies a 40% horizontal jitter.

showBox

Default: TRUE show an unjittered box-and-whisker plot at each value of x?.

boxFill

Default: "steelblue2": the colour with which the box-and-whisker plot is filled

boxColour

Default: boxFill: the colour with which the outline of the box-and-whisker plot is drawn

boxColor

Default: boxColour: US-English version of boxColour

boxAlpha

Default: 0.25 The transparency of the box-and-whisker plot. If alpha=0, the box is invisible. If alpha=1, the box is totally opaque.

boxWidth

Default: 0.5 The width of each box in the box-and-whisker plot, in the same units as those used on the x-axis

showLegend

Default: TRUE Should the legend defined by group appear in the plot

...

additional parameters passed to ggplot2 functions and stat

Value

a gg object

Usage notes

limits should be a list of lists, each element of which defines the label (default ""), colour (default "black"), line type (default "solid"), y co-ordinate (default 1), x co-ordinate (default 0), and vertical offset (vjust) (default -1) of a reference line. If any element of the component lists is missing, a warning is issued and a default value supplied. For example: limits=list(list(label="QTL (12%)", colour="red", type="dashed", y=12, x=1.5, vjust=-1),list(label="Sec Lim (8%)", colour="goldenrod", type="dotted", y=58, x=1.25, vjust=-1))

If summarise is TRUE, the (participant-level) information in data is summarised before the plot is created. data is grouped by group and x and then y=stat(y) and size=sum(size) are calculated, where x, y, size and stat are the parameters defined above.