chord_chart: Create an HTML chord diagram from matrix information

Description Usage Arguments Value

View source: R/chord_chart.R

Description

Create an HTML chord diagram from matrix information

Usage

1
2
chord_chart(df, origin = "origin", destination = "destination",
  flow = NULL, ...)

Arguments

df

A data-frame representation of flows

origin

The character name of the variable to use as an origin.

destination

The character name of the variable to use as a destination.

flow

The character name of the variable to use as a flow.

...

Arguments passed on to chorddiag::chorddiag

data

A matrix containing the data. Must be square for the "directional" type. Column names of the matrix (if existing) will be used as group labels unless the groupNames argument is explicitely set. For the "bipartite" type, the column names label the groups on the left side of the chord diagram whereas the row names label the groups on the right side.

type

A character string for the type of chord diagram. Either "directional" (default) or "bipartite" (chord diagrams can be helpful for visualising symmetric relations between two categories of groups, i.e. contingency tables).

width

Width for the chord diagram's frame area in pixels (if NULL then width is automatically determined based on context).

height

Height for the chord diagram's frame area in pixels (if NULL then height is automatically determined based on context).

margin

Numeric margin in pixels between the outer diagram radius and the edge of the display.

palette

A character string. The name of the colorbrewer palette to be used. For bipartite diagrams, the palette is used for the column groups.

palette2

A character string. Only used for bipartite diagrams where it is the name of the colorbrewer palette to be used for the row groups.

showGroupnames

A logical scalar.

groupNames

A vector of character strings to be used for group labeling.

groupColors

A vector of colors to be used for the groups. Specifying groupColors overrides any palette given. For bipartite diagrams, the colors used for the row groups must precede the colors for the column groups.

groupThickness

Numeric thickness for the groups as a fraction of the total diagram radius.

groupPadding

Numeric padding in degrees between groups.

groupnamePadding

Numeric padding in pixels between diagram (outer circle) and group labels. Use this argument if group labels overlap with tick labels. Either a scalar value to be applied to all group labels or a numeric vector specifying padding for each group label separately.

groupnameFontsize

Numeric font size in pixels for the group labels.

groupedgeColor

Color for the group edges. If NULL group colors will be used.

chordedgeColor

Color for the chord edges.

categoryNames

A length-2 vector of character strings to be used for category labels (left and right side of a bipartite chord diagram).

categorynamePadding

Numeric padding in pixels between diagram (outer circle) and category labels in bipartite diagrams. Use this argument if category labels overlap with tick or group labels.

categorynameFontsize

Numeric font size in pixels for the category labels in a bipartite diagram.

showTicks

A logical scalar.

tickInterval

A numeric value.

ticklabelFontsize

Numeric font size in pixels for the tick labels.

fadeLevel

Numeric chord fade level (opacity value between 0 and 1, defaults to 0.1).

showTooltips

A logical scalar (defaults to TRUE).

showZeroTooltips

A logical scalar (defaults to TRUE). If set to FALSE, tooltips for the value zero are hidden.

tooltipNames

A vector of character strings to be used for group labeling in tooltips. By default equal to groupNames.

tooltipUnit

A character string for the units to be used in tooltips.

tooltipFontsize

Numeric font size in pixels for the tooltips.

tooltipGroupConnector

A character string to be used in tooltips: "<source group> <tooltipGroupConnector> <target group>". Defaults to a triangle pointing from source to target.

precision

Integer number of significant digits to be used for tooltip display.

clickAction

character string containing JavaScript code to be executed on a mouse click so that shiny can get the sourceIndex and targetIndex for the purpose of filtering the data on other visualizations

Value

An htmlwidgets object showing the flow between origins and destinations in the data frame.


pbsag/outviz documentation built on Dec. 7, 2019, 5:50 a.m.