Package 'ggBubbles'

Title: Mini Bubble Plots for Comparison of Discrete Data with 'ggplot2'
Description: When comparing discrete data mini bubble plots allow displaying more information than traditional bubble plots via colour, shape or labels. Exact overlapping coordinates will be transformed so they surround the original point circularly without overlapping. This is implemented as a position_surround() function for 'ggplot2'.
Authors: Thomas Schwarzl [aut, cre]
Maintainer: Thomas Schwarzl <[email protected]>
License: LGPL (>= 3)
Version: 0.1.4
Built: 2024-12-04 07:16:47 UTC
Source: CRAN

Help Index


Calculate offsets for a specific point, in a layer, position

Description

each side has several layers, with a number of positions in the layer

Usage

calc_offset(position, layer, side, offset_x = 0.1, offset_y = 0.1)

Arguments

position

number for position at the particular side on the layer

layer

number of layer

side

side for offset 1 - top 2 - right 3 - bottom 4 - left

offset_x

offset for x axis

offset_y

offset for y axis

Value

integer vector of length 2 position 1 is new x value, position y is new y value


Calculates offset table for number of maximum overlapping positions

Description

Calculates offset table for number of maximum overlapping positions

Usage

get_offset_table(max_positions, offset_x, offset_y)

Arguments

max_positions

number of maximal exact overlaps

offset_x

offset for positon distance

offset_y

offset for in-between layer distance

Value

data frame with position, offsets_x and offsets_y


Survey about genre interests of some hobby musicians

Description

Tibble of what genre they are interested in, what instrument they play and what level the play their instrument at (1 = beginner, 2 = intermediate, 3 = experienced, 4 = very experienced, 5 = pro). Also there is an ID for the musician.

Usage

data(MusicianInterests)

Format

An object of class "data.frame";

Examples

library(ggBubbles)
data(MusicianInterests)
head(MusicianInterests)

Small test data of musician, interest and experience study

Description

Data.frame of what genre they are interested in, what instrument they play and what level the play their instrument at.

Usage

data(MusicianInterestsSmall)

Format

An object of class "data.frame";

Examples

library(ggBubbles)
data(MusicianInterestsSmall)
head(MusicianInterestsSmall)

Surrounds exact overlapping points around the center

Description

Bubble plots sometimes can be hard to interpret, especially if you want to overlay an additional feature. Instead of having to colour one blob with this function you can plot the individuals contributing to the bubble and colour them accordingly.

Usage

position_surround(offset = 0.1)

Arguments

offset

setting offset for x and y axis added to the points surrounding the exact position.

Default is 0.1

Value

ggproto

Examples

library(ggplot2)
 library(ggBubbles)
 data(MusicianInterestsSmall)

 ggplot(data = MusicianInterestsSmall, aes(x = Instrument, y = Genre, col = Level)) +
        geom_point(position = position_surround(), size = 4) +
        scale_colour_manual(values = c("#333333", "#666666", "#999999", "#CCCCCC")) + theme_bw()

ggproto for position_surround()

Description

ggproto for position_surround()