Draw a stage plot.
Arguments
- e
An
echarts4robject as returned bye_chartsor a proxy as returned byecharts4rProxy.- start
column for start of stage on x axis
- end
column for end of stage on x axis
- stage
column for stage on y axis
- legend
Whether to add serie to legend.
- name
name of the serie.
- borderRadius
The border radius of the stage.
- verticalMargin
The vertical margin of the bars.
- minHorizontalSize
The minimum width of the bars.
- envelope
The envelope of the stage.
- axisLabel
The style of the axis label.
- ...
additional options
Examples
df <- data.frame(
start = as.POSIXct(c(
"2024-09-07 06:12", "2024-09-07 06:15", "2024-09-07 05:45",
"2024-09-07 04:57", "2024-09-07 06:12", "2024-09-07 06:18"
)),
end = as.POSIXct(c(
"2024-09-07 06:12", "2024-09-07 06:18", "2024-09-07 06:12",
"2024-09-07 05:45", "2024-09-07 06:15", "2024-09-07 07:37"
)),
stage = c(
"Awake", "Awake", "REM",
"Core", "Core", "Deep"
),
stringsAsFactors = FALSE
)
stage_order = c( "Deep", "Core","REM", "Awake")
df |>
e_charts() |>
e_stage(start = start,
end = end,
stage = stage) |>
e_x_axis(type = 'time') |>
e_y_axis(type = 'category', data = stage_order)
