By binding R functions and the 'Highcharts' http://www.highcharts.com/ charting library, 'hpackedbubble' package provides a simple way to draw split packed bubble charts.
hpackedbubble(cat, name, value, theme = "sandsignika", width = NULL,
height = NULL, title = "", titleAlign = "center",
titleSize = "20px", titleColor = "#333333", subtitle = "",
subtitleAlign = "center", subtitleSize = "",
subtitleColor = "#666666",
pointFormat = "{point.name}: {point.y}", split = 1,
packedbubbleMinSize = "50%", packedbubbleMaxSize = "250%",
packedbubbleZMin = 0, packedbubbleZmax = 1000,
gravitational = 0.0625, seriesInteraction = 1,
dragBetweenSeries = 1, parentNodeLimit = 1, dataLabels = 1,
dataLabelsformat = "{point.name}", dataLabelsFilter = 250,
dataLabelsColor = "black")
category verctor;
name vector;
value vector;
chart theme, you can use these themes: darkgreen/darkblue/avocado/darkunica/gray/ gridlight/grid/sandsignika/sunset;
chart width, for example, "100%";
chart height, for example, "400px";
title;
title alignment, left/center/right;
title size, like "20px";
title color, like "#333333";
subtitle;
subtitle alignment, left/center/right;
subtitle size, like "16px";
subtitle color, like "#666666"
The HTML of the point's line in the tooltip.
Whether to split series into individual groups or to mix all series together. 1 means to split, 0 means to not, defaults to split;
Minimum bubble size. Defaults to '50%';
Maximum bubble size. Defaults to '250%';
The minimum for the Z value range. Defaults to 0, you can use the lowest Z value in the data;
The maximum for the Z value range. Defaults to 1000, you can use the highest Z value in the data;
Gravitational const used in the barycenter force of the algorithm. Defaults to 0.0625.
Whether series should interact with each other or not. 1 means to true, 0 means to false, defaults to 1;
In case of split series, this option allows user to drag and drop points between series, for changing point related series. 1 means to true, 0 means to false, defaults to 1;
Whether bubbles should interact with their parentNode to keep them inside. 1 means to true, 0 means to false, defaults to 1;
Options for the series data labels, appearing next to each data point. 1 means to true, 0 means to false, defaults to 1;
Data labels' format
Show data labels while 'value' larger than dataLabelsFilter. defaults to 250.
Data labels' color, defaults to black.
# NOT RUN {
library(hpackedbubble)
if (interactive()) {
hpackedbubble(CO2$continent, CO2$country, CO2$CO2)
}
# }
Run the code above in your browser using DataLab