Description Usage Arguments Value Examples
Hierarchical data visualisation (space-saving version) to print the all 3 levels of nodes
1 2 3 4 5 6 7 8 9 10 | group.plot_all(
tree,
x.name,
...,
y.name = NULL,
index = 1,
levels.shown = 3,
aspect = NULL,
color = NULL
)
|
tree |
a data tree object |
x.name |
a character value indicating x variable |
... |
ggplot functions and layers to be passed on |
y.name |
a character value indicating y variable |
index |
labels size and tree branches (lines) thickness |
levels.shown |
a numeric value indicating which level plot up to |
aspect |
plot aspect ratio |
color |
a character value indicating which variable to use for colouring |
a svg file will be saved in the current working directory and automatically opened in a web broswer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## 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_all(employee.tree, x.name ="Age", y.name ="MonthlyIncome",
color = "EducationField", index = 2,
levels.shown = 3, aspect = 3/4, geom_point(), geom_smooth())
# only singe variable
group.plot_all(employee.tree, x.name ="MonthlyIncome",
color = "Gender", index = 2,
levels.shown = 1, geom_density())
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.