1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gvisBubbleChart.R
\name{gvisBubbleChart}
\alias{gvisBubbleChart}
\title{Google Bubble Chart with R
\Sexpr{googleChartName <- "bubblechart"}
\Sexpr{gvisChartName <- "gvisBubbleChart"}}
\usage{
gvisBubbleChart(
data,
idvar = "",
xvar = "",
yvar = "",
colorvar = "",
sizevar = "",
options = list(),
chartid
)
}
\arguments{
\item{data}{a \code{\link{data.frame}} to be displayed as a bubble chart.
The data has to have at least three columns for \code{idvar, xvar}, and
\code{yvar}.}
\item{idvar}{column name of \code{data} with the bubble}
\item{xvar}{column name of a numerical vector in \code{data} to be plotted
on the x-axis.}
\item{yvar}{column name of a numerical vector in \code{data} to be plotted
on the y-axis.}
\item{colorvar}{column name of data that identifies bubbles in the same
series. Use the same value to identify all bubbles that belong to the same
series; bubbles in the same series will be assigned the same color. Series
can be configured using the \code{series} option.}
\item{sizevar}{values in this column are mapped to actual pixel values using
the \code{sizeAxis} option.}
\item{options}{list of configuration options, see:
% START DYNAMIC CONTENT
\Sexpr[results=rd]{gsub("CHARTNAME",
googleChartName,
readLines(file.path(".", "inst", "mansections",
"GoogleChartToolsURLConfigOptions.txt")))}
\Sexpr[results=rd]{paste(readLines(file.path(".", "inst",
"mansections", "gvisOptions.txt")))}}
\item{chartid}{character. If missing (default) a random chart id will be
generated based on chart type and \code{\link{tempfile}}.}
}
\value{
\Sexpr[results=rd]{paste(gvisChartName)} returns list
of \code{\link{class}}
\Sexpr[results=rd]{paste(readLines(file.path(".", "inst",
"mansections", "gvisOutputStructure.txt")))}
}
\description{
The gvisBubbleChart function reads a data.frame and creates text output
referring to the Google Visualisation API, which can be included into a web
page, or as a stand-alone page.
}
\details{
A bubble chart is used to visualize a data set with 2 to 4 dimensions. The
first two dimensions are visualized as coordinates, the 3rd as color and the
4th as size.
The bubble chart is rendered within the browser using SVG or VML and
displays tips when hovering over points.
}
\examples{
bubble1 <- gvisBubbleChart(Fruits, idvar="Fruit", xvar="Sales", yvar="Expenses")
plot(bubble1)
## Set color and size
bubble2 <- gvisBubbleChart(Fruits, idvar="Fruit", xvar="Sales", yvar="Expenses",
colorvar="Location", sizevar="Profit",
options=list(hAxis='{minValue:75, maxValue:125}'))
plot(bubble2)
## Use year to color the bubbles
bubble3 <- gvisBubbleChart(Fruits, idvar="Fruit", xvar="Sales", yvar="Expenses",
colorvar="Year", sizevar="Profit",
options=list(hAxis='{minValue:75, maxValue:125}'))
plot(bubble3)
## Gradient colour example
bubble4 <- gvisBubbleChart(Fruits, idvar="Fruit", xvar="Sales", yvar="Expenses",
sizevar="Profit",
options=list(hAxis='{minValue:75, maxValue:125}',
colorAxis="{colors: ['lightblue', 'blue']}"))
plot(bubble4)
\dontrun{
## Moving bubble chart over time, aka motion chart
M <- gvisMotionChart(Fruits, Fruit, Year)
plot(M)
}
}
\references{
Google Chart Tools API:
\Sexpr[results=rd]{gsub("CHARTNAME",
googleChartName,
readLines(file.path(".", "inst", "mansections",
"GoogleChartToolsURL.txt")))}
% END DYNAMIC CONTENT
}
\seealso{
See also \code{\link{gvisMotionChart}} for a moving bubble chart
over time, and \code{\link{print.gvis}}, \code{\link{plot.gvis}} for
printing and plotting methods.
}
\author{
Markus Gesmann \email{markus.gesmann@gmail.com},
Diego de Castillo \email{decastillo@gmail.com}
}
\keyword{iplot}
|