bubbleplot: Bubble evidence map plotting function

Description Usage Arguments Value Examples

View source: R/bubbleplot.R

Description

Plots a bubble evidence map for a systematic map, evidence gap map or similar.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
bubbleplot(
  x_var,
  xlabels = "",
  y_var,
  ylabels = "",
  clr_var,
  clr_legend = "",
  bub_legend = "Number of studies",
  n,
  wrap_width = 10,
  bg_col = "#BFD5E3",
  title = "",
  subtitle = "",
  x_title = "",
  y_title = "",
  palette = "Set2",
  interactive = FALSE,
  hovertext = ""
)

Arguments

x_var

Variable to plot on the x-axis. Variable should be ordinal or categorical. Vectors of strings are converted to ordinal for plotting, with original levels shown on the plot.

xlabels

Optional vector of strings used to plot x-axis labels if x_var is ordinal.

y_var

Variable to plot on the y-axis. Variable should be ordinal or categorical. Vectors of strings are converted to ordinal for plotting, with original levels shown on the plot.

ylabels

Optional vector of strings used to plot x-axis labels if y_var is ordinal.

clr_var

Variable (vector) used to colour bubbles. Up to five levels of the vector may be plotted as different bubbles.

clr_legend

Optional name of clr_var variable used to colour bubbles. This string is used to label the legend.

bub_legend

Optional label for the bubble size legend. Default is 'Number of studies'.

n

Numerical variable corresponding to the number of studies and used to alter the size of the bubbles.

wrap_width

The width of axis labels using character wrapping. The default is 'wrap_width = 10'.

bg_col

The background colour for the plot area. The default is 'bg_col = "#BFD5E3"'.

title

Optional plot title.

subtitle

Optional plot subtitle.

x_title

X-axis title.

y_title

Y-axis title.

palette

Palette colour used to colour bubbles. The default is 'palette = "Set2"'.

interactive

Logical argument (TRUE or FALSE) specifying whether the plot should be made interactive or not. Interactive plots include a hoverover tooltip containing additional text.

hovertext

Optional string containing text to plot in the hoverover tooltip.

Value

Plots an interactive bubble evidence map (using ggplotly)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
data <- read.csv2('inst/extdata/data.csv', sep=',')
attach(data)
plot <- bubbleplot(x_var = inst, 
    y_var = outcome, 
    clr_var = loc,
    clr_legend = 'Location',
    n = n,
    bg_col = '#F1EFF3',
    title = 'RCTs in Education',
    subtitle = 'Data from 1980 to 2017',
    x_title = 'Institution',
    y_title = 'Outcome',
    palette = 'Set2',
    interactive = TRUE,
    hovertext = 'test')
plot

## End(Not run)

nealhaddaway/evimappr documentation built on Jan. 1, 2021, 11:36 a.m.