vt_input_from_df: vt_input_from_df

Description Usage Arguments Value Examples

Description

create a tree-structure from a data.frame

Usage

1
2
vt_input_from_df(inp, scaleToPerc = FALSE, hierachyVar0 = NULL,
  hierachyVar1, hierachyVar2, colorVar, weightVar, labelVar = NULL)

Arguments

inp

a data.frame with specific format

scaleToPerc

(logical) scale to percent

hierachyVar0

(character) variable name of toplevel hierachy (will be replaced with "Total" if empty)

hierachyVar1

(character) variable name of first level

hierachyVar2

(character) variable name of second level

colorVar

(character) variable name of the color information

weightVar

(character) variable name of the weight information

labelVar

(character) variable name of (short) labels

Value

a Node that can be written to json using vt_export_json

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(canada)
canada <- canada[canada$h1=="Canada",]
canada$codes <- canada$h3
v1 <- vt_input_from_df(canada, hierachyVar0 = "h1", hierachyVar1 = "h2",
  hierachyVar2 = "h3", colorVar = "color",weightVar = "weight",
  labelVar = "codes")
 colnames(canada) <- c("hier1","hier2","hier3","col","w","cod")
v2 <- vt_input_from_df(canada, hierachyVar0 = "hier1", hierachyVar1 = "hier2",
    hierachyVar2 = "hier3", colorVar = "col",weightVar = "w",
    labelVar = "cod")
    

uRosConf/voronoiTreemap documentation built on July 3, 2019, 12:25 a.m.