This repository has been archived by the owner on Jul 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an option to visualize custom (numeric) attributes on the edges…
… and nodes of a process map
- Loading branch information
1 parent
81473d8
commit dc92e54
Showing
4 changed files
with
133 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#' @title Custom map profile | ||
#' @description Function to create a custom map profile based on some event log attribute. | ||
#' @param FUN A summary function to be called on the provided event attribute, e.g. mean, median, min, max | ||
#' @param attribute The name of the case attribute to visualize | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' library(eventdataR) | ||
#' library(processmapR) | ||
#' data(traffic_fines) | ||
#' # make sure the amount attribute is propagated forward in each trace | ||
#' # using zoo::na.locf instead of tidyr::fill since it is much faster | ||
#' # still the whole pre-processing is still very slow | ||
#' library(zoo) | ||
#' traffic_fines_prepared <- traffic_fines %>% filter_trace_frequency(percentage = 0.8) %>% group_by_case() %>% mutate(amount = na.locf(amount, na.rm = F)) %>% ungroup_eventlog() | ||
#' process_map(traffic_fines_prepared, type_nodes = custom(attribute = "amount", units = "EUR")) | ||
#' } | ||
#' | ||
#' @export custom | ||
|
||
|
||
|
||
|
||
custom <- function(FUN = mean, attribute, units = "") { | ||
attr(FUN, "attribute") <- attribute | ||
attr(FUN, "units") <- units | ||
attr(FUN, "perspective") <- "custom" | ||
return(FUN) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.