hp_datatree: Create a hierplane object using data.tree

Description Usage Arguments Examples

View source: R/hp_datatree.R

Description

The data.tree package is a popular, general purpose hierarchical data structure for R. Therefore, hp_datatree tries to make it so hierplane is compatible with data.tree objects.

Usage

1
2
3
4
5
6
7
8
hp_datatree(
  .data,
  title = "Hierplane",
  attributes = NULL,
  link = "to",
  node_type = "from",
  styles = NULL
)

Arguments

.data

A data.tree object of class "Node".

title

A title, defaults to "Hierplane", this serves as the header/title of the hierplane.

attributes

Attributes to assign to the nodes, these are the annotation in the nodes.

link

Link connecting each node, theres are the tabs or connections you see between each node.

node_type

A column name that determines the node colors.

styles

Assign styles to hierplane generated from hierplane_styles().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Not run: 
library(hierplane)
library(data.tree)
library(yaml)

yaml <- "
name: r4fun
tyler:
  name: Tyler
  job: Data Scientist
  species: Human
  toulouse:
    name: Toulouse
    job: Systems Engineer
    species: Cat
    jojo:
      name: Jojo
      job: Python Programmer
      species: Dog
  ollie:
    name: Ollie
    job: Database Administrator
    species: Dog
  lucas:
    name: Lucas
    job: R Programmer
    species: Rabbit
"

yaml %>%
  yaml.load() %>%
  as.Node() %>%
  hp_datatree(
    node_type = "species",
    link = "species",
    attributes = "job"
  ) %>%
  hierplane()

## End(Not run)

r4fun/hierplane documentation built on Aug. 1, 2020, 9:48 a.m.