Skip to contents

A lined chart is a graph in which each activity instance is displayed with a line. The x-axis refers to the time aspect, while the y-axis refers to cases.

Usage

lined_chart(
  log,
  x = c("absolute", "relative"),
  sort = c("auto", "start", "end", "duration"),
  color = NULL,
  units = c("auto", "secs", "mins", "hours", "days", "weeks"),
  line_width = 2,
  plotly = FALSE,
  scale_color = bupaR::scale_color_discrete_bupaR,
  eventlog = deprecated()
)

# S3 method for class 'eventlog'
lined_chart(
  log,
  x = c("absolute", "relative"),
  sort = c("auto", "start", "end", "duration"),
  color = NULL,
  units = c("auto", "secs", "mins", "hours", "days", "weeks"),
  line_width = 2,
  plotly = FALSE,
  scale_color = bupaR::scale_color_discrete_bupaR,
  eventlog = deprecated()
)

# S3 method for class 'activitylog'
lined_chart(
  log,
  x = c("absolute", "relative"),
  sort = c("auto", "start", "end", "duration"),
  color = NULL,
  units = c("auto", "secs", "mins", "hours", "days", "weeks"),
  line_width = 2,
  plotly = FALSE,
  scale_color = bupaR::scale_color_discrete_bupaR,
  eventlog = deprecated()
)

# S3 method for class 'grouped_eventlog'
lined_chart(
  log,
  x = c("absolute", "relative"),
  sort = c("auto", "start", "end", "duration"),
  color = NULL,
  units = c("auto", "secs", "mins", "hours", "days", "weeks"),
  line_width = 2,
  plotly = FALSE,
  scale_color = bupaR::scale_color_discrete_bupaR,
  eventlog = deprecated()
)

# S3 method for class 'grouped_activitylog'
lined_chart(
  log,
  x = c("absolute", "relative"),
  sort = c("auto", "start", "end", "duration"),
  color = NULL,
  units = c("auto", "secs", "mins", "hours", "days", "weeks"),
  line_width = 2,
  plotly = FALSE,
  scale_color = bupaR::scale_color_discrete_bupaR,
  eventlog = deprecated()
)

Arguments

log

log: Object of class log or derivatives (grouped_log, eventlog, activitylog, etc.).

x

character (default "absolute"): Value to plot on x-axis: "absolute" time or "relative" time.

sort

character (default "auto"): Ordering of the cases on y-axis: "auto" (default, see Details), "start", "end", or "duration".

color

character (default NULL): Attribute to use for coloring the activity instances (dots). This attribute should be present in log. Default (NULL) is the activity identifier (activity_id()). Use NA for no colors.

units

character (default "auto"): Time units to use on the x-axis in case of relative time: "auto" (default, see Details), "secs", "mins", "hours", "days", or "weeks".

line_width

numeric (default 2): The width of lines.

plotly

logical (default FALSE): Return a plotly object, instead of a ggplot2.

scale_color

ggplot2 scale function (default scale_color_discrete_bupaR): Set color scale. Defaults to scale_color_discrete_bupaR. Replaced with scale_color_discrete when more than 26 activities are present.

eventlog

[Deprecated]; please use log instead.

Details

When setting sort to "auto", the ordering of cases is done automatically, based on the specified value of x:

  • x = "absolute": sort = "start",

  • x = "relative": sort = "duration".

When setting units to "auto", the time units on the x-axis is done automatically, based on the specified value of x:

  • x = "absolute": units = "weeks",

  • x = "relative": units = "weeks".

Methods (by class)

  • lined_chart(eventlog): Create lined chart for an eventlog.

  • lined_chart(activitylog): Create lined chart for an activitylog.

  • lined_chart(grouped_eventlog): Create lined chart for a grouped_eventlog.

  • lined_chart(grouped_activitylog): Create lined chart for a grouped_activitylog.

See also

Examples

library(processmapR)
library(eventdataR)

patients %>%
 lined_chart(x = "absolute", color = "employee")