group.plot_selected: Hierarchical data visualisation (space-saving version) to...

Description Usage Arguments Value Examples

View source: R/group.plot.R

Description

Hierarchical data visualisation (space-saving version) to print the first 2 levels + the 3rd level of selected node expanded out

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
group.plot_selected(
  tree,
  x.name,
  node.shown,
  ...,
  y.name = NULL,
  index = 1,
  aspect = NULL,
  color = NULL
)

Arguments

tree

a data tree object

x.name

a character value indicating x variable

node.shown

node selected in the 2nd hierarchy level to be expanded out

...

ggplot functions and layers to be passed on

y.name

a character value indicating y variable

index

labels size and tree branches (lines) thickness

aspect

plot aspect ratio

color

a character value indicating which variable to use for colouring

Value

a svg file will be saved in the current working directory and automatically opened in a web broswer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# load the employee data
data(employee)

# create a data tree object from the employee dataset with a hierarchy order of:
# Employee Information -> Department -> JobRole -> EmployeeNumber
employee.tree = createTree(employee, "Employee Information",
           c("Department", "JobRole", "EmployeeNumber"))


# x and y variables
group.plot_selected(employee.tree, x.name ="Age", y.name ="MonthlyIncome", index = 2,
                    node.shown = "Sales", aspect = 3/5, geom_point(), geom_smooth(model = lm))

# only singe variable
group.plot_selected(employee.tree, x.name ="MonthlyIncome", color = "EducationField", index = 2,
                    node.shown = "Human Resources", geom_density())

## End(Not run)

nzjessica/treevis documentation built on June 27, 2020, 1:20 a.m.