Learn R Programming

echarts4r (version 0.5.0)

e_matrix_parent: Generate Matrix Axis Parents

Description

helper function for generating parent values for x or y axis headers

Usage

e_matrix_parent(e, axis = "x", value, children, ...)

Arguments

e

An echarts4r object as returned by e_charts or a proxy as returned by echarts4rProxy.

axis

which axis the parent should be added

value

text for the new parent header cell

children

vector containing values for which current header cells will be children for the new parent cell

...

Any other option to pass, check See Also section.

See Also

Examples

Run this code

df <- data.frame("Class" = rep(c("Class1", "Class2", "Class3"),each = 3),
"Grade" = c("Grade1","Grade2", "Grade3"),
"A" = sample(1:10, 9),
"B" = sample(1:10,9))

df |> e_charts() |> e_matrix(xAxis = "Class", yAxis = "Grade") |>
e_matrix_parent(value = "Primary", children = c("Class1", "Class2")) |>
e_matrix_parent(value = "High", children = "Class3")

Run the code above in your browser using DataLab