View source: R/clock_chart_qnt.R
clock_chart_qnt | R Documentation |
This function will plot time of events on a 24 hour clock to show which events took place at what times. The length and color of the hands are modified according to a numeric vector.
clock_chart_qnt(data, time, len, Col = NULL, high = "red", low = "green")
data |
A data frame |
time |
Time in 24 hours. The allowed time formats for these family
of charts are |
len |
The numeric vector by which hands will be modified and colored. |
Col |
Optional. A numeric vector to change color. This option will be discontinued. |
high |
The color name for the high values. The default is |
low |
The color name for the low values. The default is |
Change the title, subtitle or the caption of the plot with
ggplot2::labs()
.Change the legend title by adding
ggplot2::labs(color = "TITLE 1", size = "TITLE2")
.
Add
or modify legend by theme(legend.position = "POSITION")
; the valid
position names in ggplot2
are top
, bottom
, right
, and left
,
excluding more complex options.
A ggplot
object, which can be further modified
with ggplot2
functions and themes.
clock_chart_col()
for coloring by a numeric variable,
clock_chart_qlt()
for coloring by a qualitative variable,
clock_chart()
for the simplest clock chart
p1 <- clock_chart_qnt(
data = bdquake, time = hms, len = depth,
Col = mag, high = "red", low = "blue"
)
p1 + ggplot2::labs(
color = "Depth", size = "Magnitude",
title = "Earthquakes in Bangladesh since 2023"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.