Learn R Programming

⚠️There's a newer version (0.3.0) of this package.Take me there.

Package ggiraphExtra contains many useful functions for exploratoty plots. These functions are made by both 'ggplot2' and 'ggiraph' packages. You can make a static ggplot or an interactive ggplot by setting the parameter interactive=TRUE.

Package installation

You can install package ggiraphExtra with the following command.

#install.packages("devtools")
devtools::install_github("cardiomoon/ggiraphExtra")

ggPoints() for interactive scatterplot with regression equation

You can make interactive ggplot easily. You can hover the points, see the regression equations and zoom-in zoom-out with the mouse wheel.

require(ggplot2)
require(ggiraph)
require(ggiraphExtra)

ggPoints(aes(x=wt,y=mpg,color=am),data=mtcars,method="lm")

You can draw scatter plot for binary dependent variable. The GBSG2 data contains data of 686 observations from the German Breast Cancer Study Group 2(GBSG2) study. You can get logistic regression line with a jittered scatterplot by setting the parameter method glm.

require(TH.data)
data(GBSG2)
ggPoints(aes(x=pnodes,y=cens),data=GBSG2,method="glm")

Please check the vignette for "ggPoints" at http://rpubs.com/cardiomoon/231822

ggRadar() for interactive radar chart

You can explore a data.frame with ggRadar() or ggBoxplot().

ggRadar(data=iris,aes(color=Species))

ggRadar(data=mtcars,aes(colour=am))

ggSpine() for an interactive spinogram

ggSpine() is a interactive ggplot version of spineplot(). Spine plots are a special cases of mosaic plots, and can be seen as a generalization of stacked (or highlighted) bar plots. Analogously, spinograms are an extension of histograms. You can add labels by setting the parameter addlabel=TRUE.

require(moonBook)
ggSpine(data=acs,aes(x=age,fill=smoking))

ggSpine(data=acs,aes(x=Dx,fill=smoking),addlabel=TRUE)

## ggBar() for an interactive barplot

ggBar() draws interactive barplot. You can add labels, draw horizontal barplots or polar plots. You can draw histogram with ggBar()

ggBar(acs,aes(x=Dx,fill=smoking),addlabel=TRUE,horizontal=TRUE,width=0.5)

ggBar(rose,aes(x=Month,fill=group,y=value),stat="identity",polar=TRUE,palette="Reds",width=1,
       color="black",size=0.1)

ggBar(acs,aes(x=age,fill=smoking),addlabel=TRUE,horizontal=TRUE,width=0.5)

ggPair() for an interactive scatter plot with line plot

ggPair(iris[3:5])

ggPair(iris,aes(color=Species),horizontal=TRUE)

ggPieDonut() for a pie and donut plot

You can draw a pie and donut plot with ggPieDonut().

ggPieDonut(acs,aes(pies=Dx,donuts=smoking))

ggPieDonut(browsers,aes(pies=browser,donuts=version,count=share))

ggDonut(browsers,aes(donuts=version,count=share))

ggCLE() for a cleveland dot plot

require(gcookbook)
mtcars$name=rownames(mtcars)
ggCLE(data=mtcars,aes(x=mpg,y=name,color=am,facet=am))

ggCLE(data=tophitters2001,aes(x=avg,y=name,color=lg,facet=lg),no=20)

Full version of this vignette

You can find the full version of this vignette at http://rpubs.com/cardiomoon/231820

Copy Link

Version

Install

install.packages('ggiraphExtra')

Monthly Downloads

3,158

Version

0.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

KeonWoong Moon

Last Published

December 3rd, 2016

Functions in ggiraphExtra (0.1.0)

ggBar

Draw an interactive barplot
ggPieDonut

Draw a Pie and Donut plot
ggPoints

Make an interactive scatterplot with regression line(s)
ggHSD

Draw Tukey Honest Significant Differences plot
ggDot

Draw a Wilkinson dot plot
ggPair

Make an interactive scatter and line plot
ggRadar

Draw a radar chart
num2cut

Computing breaks for make a histogram of a continuous variable
model2df

Make a data.fram of yhat with a model
ggEffect

Visualize the effect of interaction between two continuous independent variables on a response variable
ggRose

Draw an interactive Rose plot
rescale_df

Rescale all numeric variables of a data.frame except grouping variable
subcolors

Make a subcolors according to the mainCol
rose

Rose sales among 7 groups in a year
theme_clean

Clean theme for PieDonut plot
summarySE

Summarize a continuous variable by groups with mean, sd and SE
taco

Taco ratings by age group
ggSpine

Draw an interactive spinogram
unselectNumeric

Unselect numeric column of a data.frame
makeEq

Make a regression equation of a model
ggErrorBar

Make an interactive bar plot with error bar
ggHeatmap

Make an interactive Heatmap
num2factorDf

Make numeric column of a data.frame to factor
pastecolon

Paste character vectors separated by colon
ggBoxplot

Draw boxplots of a data.frame
ggCor

Draw a heatmap of correlation test
coord_radar

The radar coordinate system is a modification of polar coordinate system, commly used for radar chart
ggDonut

Draw a Donut plot
ggCLE

Draw a cleveland dot plot
ggChoropleth

Draw an interactive choropleth map
ggCatepillar

Make an interactive catepillar plot
ggAncova

Make an interactive plot for an ANCOVA model
browsers

Browser market share 2011