Package 'sankeywheel'

Title: Create Dependency Wheels and Sankey Diagrams
Description: By binding R functions and the 'Highcharts' <http://www.highcharts.com/> charting library, 'sankeywheel' package provides a simple way to draw dependency wheels and sankey diagrams.
Authors: Zhenxing Cheng [aut, cre], Qiongqiong Li [aut, ctb]
Maintainer: Zhenxing Cheng <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-11-03 04:20:42 UTC
Source: https://github.com/cran/sankeywheel

Help Index


Example Data for Sankey Sankey Diagrams

Description

Data Source: https://www.highcharts.com/demo/sankey-diagram

Usage

sankeydf

Format

A tibble data frame with 46 rows and 3 variables.


Create Dependency Wheels and Sankey Diagrams

Description

@description By binding R functions and the 'Highcharts' http://www.highcharts.com/ charting library, 'sankeywheel' package provides a simple way to draw dependency wheels and sankey diagrams.

Usage

sankeywheel(from, to, weight, type = "dependencywheel", width = NULL,
  height = NULL, seriesName = "demo series", theme = "sandsignika",
  title = "Example Chart", titleAlign = "center", titleSize = "20px",
  titleColor = "#333333", subtitle = "", subtitleAlign = "center",
  subtitleSize = "", subtitleColor = "#666666", elementId = NULL,
  ...)

Arguments

from

from verctor;

to

to vector;

weight

weight vector;

type

Charts type, dependencywheel or sankey;

width

chart width, for example, "100%";

height

chart height, for example, "400px";

seriesName

Series name, like "demo series";

theme

chart theme, you can use these themes: darkgreen/darkblue/avocado/darkunica/gray/ gridlight/grid/sandsignika/sunset;

title

title;

titleAlign

title alignment, left/center/right;

titleSize

title size, like "20px";

titleColor

title color, like "#333333";

subtitle

subtitle;

subtitleAlign

subtitle alignment, left/center/right;

subtitleSize

subtitle size, like "16px";

subtitleColor

subtitle color, like "#666666";

elementId

NULL.

...

Additional parameters.

Examples

library(sankeywheel)
if(interactive()){
    sankeywheel(from = sankeydf$from,
        to = sankeydf$to,
        weight = sankeydf$weight,
        type = "dependencywheel")
    sankeywheel(from = sankeydf$from,
        to = sankeydf$to,
        weight = sankeydf$weight,
        type = "sankey",
        theme = "sunset")
}

Shiny bindings for sankeywheel

Description

Output and render functions for using sankeywheel within Shiny applications and interactive Rmd documents.

Usage

sankeywheelOutput(outputId, width = "100%", height = "400px")

renderSankeywheel(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

expr

An expression that generates a sankeywheel

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.