Learn R Programming

ggiraphExtra (version 0.1.0)

ggSpine: Draw an interactive spinogram

Description

Draw an interactive spinogram

Usage

ggSpine(data, mapping, stat = "count", position = "fill",
  palette = "Blues", interactive = FALSE, polar = FALSE, width = NULL,
  digits = 1, colour = "black", size = 0.2, addlabel = FALSE, ...)

Arguments

data

A data.frame

mapping

Set of aesthetic mappings created by aes or aes_.

stat

The statistical transformation to use on the data for this layer, as a string c("count","identity")

position

Position adjustment. One of the c("fill","stack","dodge")

palette

A character string indicating the color palette

interactive

A logical value. If TRUE, an interactive plot will be returned

polar

A logical value. If TRUE, coord_polar() function will be added

width

Bar width

digits

integer indicating the number of decimal places

colour

Bar colour

size

Bar size

addlabel

A logical value. If TRUE, label will be added to the plot

...

other arguments passed on to layer.

Value

An interactive spinogram

Examples

Run this code
# NOT RUN {
require(moonBook)
require(ggplot2)
require(ggiraph)
ggSpine(data=acs,aes(x=age,fill=smoking),interactive=TRUE)
ggSpine(data=acs,aes(x=Dx,fill=smoking),addlabel=TRUE,interactive=TRUE)
ggSpine(data=acs,aes(x=Dx,fill=smoking),position="dodge",addlabel=TRUE,interactive=TRUE)
ggSpine(data=acs,aes(x=Dx,fill=smoking),position="stack",addlabel=TRUE,interactive=TRUE)
# }

Run the code above in your browser using DataLab