Clock Chart, Hands Colored by a Numeric Variable
clock_chart_col.Rd
This function will plot time of events on a 24 hour clock to show which events took place at what times. The lines are colored by a criteria.
Arguments
- data
A data frame
- time
Time in 24 hours. The allowed time formats for these family of charts are
HH:MM:SS
,HH:MM
or evenH:M
(such as12;30:09
or9:3
).- crit
a numeric vector by which lines will be colored.
- high
The color name for the high values. The default is
red
- low
The color name for the high values. The default is
green
. The color names can be vice versa or other colors, depending on the context.
Details
Change the title, subtitle or the caption of the plot with
ggplot2::labs()
.Change the legend title by adding
ggplot2::labs(size = "TITLE")
or labs(color = "TITLE")
.
Add
or modify legend by theme(legend.position = "POSITION")
; the valid
postion names in ggplot2
are top
, bottom
, right
, and left
,
excluding more complex options.
See also
clock_chart_len()
for modifying length by a numeric variable,
clock_chart_qnt()
for coloring and modifying length by a numeric variable,
clock_chart_qlt()
for coloring by a qualitative variable,
clock_chart()
for the simplest clock chart
Examples
df <- data.frame(time = c("06:00:00", "08:00:00", "17:30:00"),
value = c(3,6,9))
clock_chart_col(df, time, crit = value)+
ggplot2::labs(size = "TITLE")