├── _pkgdown.yml ├── .gitignore ├── LICENSE ├── .Rbuildignore ├── docs ├── pkgdown.yml ├── link.svg ├── docsearch.js ├── pkgdown.js ├── LICENSE-text.html ├── authors.html ├── reference │ ├── reexports.html │ ├── bupaR.html │ ├── re_map.html │ ├── print.eventlog.html │ ├── print.eventlog_mapping.html │ ├── case_list.html │ ├── trace_list.html │ ├── ungroup_eventlog.html │ ├── group_by_case.html │ ├── case_labels.html │ ├── group_by_activity.html │ ├── group_by_resource.html │ └── activity_labels.html ├── pkgdown.css └── index.html ├── tests ├── testthat.R └── testthat │ └── test_slice.R ├── README.md ├── man ├── print.eventlog.Rd ├── re_map.Rd ├── reexports.Rd ├── print.eventlog_mapping.Rd ├── case_list.Rd ├── trace_list.Rd ├── bupaR.Rd ├── case_labels.Rd ├── ungroup_eventlog.Rd ├── group_by_case.Rd ├── activity_labels.Rd ├── resource_labels.Rd ├── group_by_activity.Rd ├── group_by_resource.Rd ├── summary.Rd ├── group_by_activity_instance.Rd ├── cases.Rd ├── group_by_resource_activity.Rd ├── last_n.Rd ├── slice_events.Rd ├── first_n.Rd ├── group_by.Rd ├── mapping.Rd ├── durations.Rd ├── select.Rd ├── filter.Rd ├── fill.Rd ├── mutate.Rd ├── slice_activities.Rd ├── filter_attributes.Rd ├── n_activity_instances.Rd ├── activities_to_eventlog.Rd ├── slice.Rd ├── arrange.Rd ├── resources.Rd ├── act_unite.Rd ├── n_cases.Rd ├── activities.Rd ├── n_events.Rd ├── n_traces.Rd ├── n_resources.Rd ├── act_recode.Rd ├── case_id.Rd ├── lifecycle_id.Rd ├── traces.Rd ├── n_activities.Rd ├── timestamp.Rd ├── activity_id.Rd ├── resource_id.Rd ├── unite.Rd ├── activity_instance_id.Rd ├── sample_n.Rd ├── add_end_activity.Rd ├── simple_eventlog.Rd ├── act_collapse.Rd ├── eventlog.Rd └── set_case_id.Rd ├── R ├── utils.R ├── lifecycle_id.R ├── case_id.r ├── timestamp.R ├── filter_attributes.R ├── n_events.R ├── resource_id.R ├── activity_id.R ├── mutate.eventlog.R ├── fill.eventlog.R ├── activity_instance_id.R ├── arrange.eventlog.R ├── filter.R ├── print.mapping.R ├── re_map.R ├── act_unite.R ├── n_traces.R ├── n_cases.R ├── act_recode.R ├── n_resources.R ├── mapping.R ├── n_activities.R ├── select.R ├── zzz.R ├── case_list.R ├── n_activity_instances.R ├── unite.eventlog.R ├── first_n.R ├── bupar.R ├── durations.R ├── activities_to_eventlog.R ├── last_n.R ├── summary.eventlog.R ├── trace_list.R ├── print.eventlog.R ├── sample_n.eventlog.R ├── activities.R ├── resources.R ├── cases.r ├── add_start_end_activity.R ├── traces.R ├── slice.eventlog.R ├── simple_eventlog.R ├── group_by.eventlog.R └── set_eventlog_attributes.R ├── bupaR.Rproj └── DESCRIPTION /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | inst/doc 2 | .Rproj.user 3 | .Rhistory 4 | .Rdata 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2017 2 | COPYRIGHT HOLDER: Hasselt University 3 | 4 | -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^_pkgdown\.yml$ 4 | ^docs$ 5 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 1.19.2.1 2 | pkgdown: 1.1.0 3 | pkgdown_sha: ~ 4 | articles: [] 5 | 6 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(bupaR) 3 | library(eventdataR) 4 | 5 | test_check("bupaR") 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bupaR 2 | 3 | bupaR is an open-source suite for the handling and analysis of business process data in R developed by the Business Informatics research group at Hasselt University, Belgium. It builds upon the concept of an event log which is a logbook of events which have happened and were recorded within the execution of a business process. 4 | 5 | [Read more](https://www.bupar.net) 6 | -------------------------------------------------------------------------------- /man/print.eventlog.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/print.eventlog.R 3 | \name{print.eventlog} 4 | \alias{print.eventlog} 5 | \title{Generic print function for eventlog} 6 | \usage{ 7 | \method{print}{eventlog}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{Eventlog object} 11 | 12 | \item{...}{Additional Arguments} 13 | } 14 | \description{ 15 | Generic print function for eventlog 16 | } 17 | -------------------------------------------------------------------------------- /man/re_map.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/re_map.R 3 | \name{re_map} 4 | \alias{re_map} 5 | \title{Re map} 6 | \usage{ 7 | re_map(eventlog, eventlog_mapping) 8 | } 9 | \arguments{ 10 | \item{eventlog}{The event log data to be used.} 11 | 12 | \item{eventlog_mapping}{An existing eventlog mapping created by the mapping function} 13 | } 14 | \description{ 15 | Construct and eventlog using an existing mapping. 16 | } 17 | -------------------------------------------------------------------------------- /man/reexports.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \docType{import} 4 | \name{reexports} 5 | \alias{reexports} 6 | \alias{\%>\%} 7 | \title{Objects exported from other packages} 8 | \keyword{internal} 9 | \description{ 10 | These objects are imported from other packages. Follow the links 11 | below to see their documentation. 12 | 13 | \describe{ 14 | \item{magrittr}{\code{\link[magrittr]{\%>\%}}} 15 | }} 16 | 17 | -------------------------------------------------------------------------------- /R/utils.R: -------------------------------------------------------------------------------- 1 | 2 | #' @export 3 | magrittr::`%>%` 4 | 5 | #' @importFrom rlang sym 6 | #' 7 | case_id_ <- function(eventlog) sym(case_id(eventlog)) 8 | activity_id_ <- function(eventlog) sym(activity_id(eventlog)) 9 | activity_instance_id_ <- function(eventlog) sym(activity_instance_id(eventlog)) 10 | resource_id_ <- function(eventlog) sym(resource_id(eventlog)) 11 | timestamp_ <- function(eventlog) sym(timestamp(eventlog)) 12 | lifecycle_id_ <- function(eventlog) sym(lifecycle_id(eventlog)) 13 | -------------------------------------------------------------------------------- /bupaR.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: No 9 | NumSpacesForTab: 4 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /man/print.eventlog_mapping.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/print.mapping.R 3 | \name{print.eventlog_mapping} 4 | \alias{print.eventlog_mapping} 5 | \title{Generic print function for eventlog_mapping} 6 | \usage{ 7 | \method{print}{eventlog_mapping}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{Eventlog mapping object} 11 | 12 | \item{...}{Additional Arguments} 13 | } 14 | \description{ 15 | Generic print function for eventlog_mapping 16 | } 17 | -------------------------------------------------------------------------------- /man/case_list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/case_list.R 3 | \name{case_list} 4 | \alias{case_list} 5 | \alias{case_list.eventlog} 6 | \title{Case list} 7 | \usage{ 8 | case_list(eventlog) 9 | 10 | \method{case_list}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog object} 14 | } 15 | \description{ 16 | Construct list of cases 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Return case list 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /man/trace_list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/trace_list.R 3 | \name{trace_list} 4 | \alias{trace_list} 5 | \alias{trace_list.eventlog} 6 | \title{Trace list} 7 | \usage{ 8 | trace_list(eventlog) 9 | 10 | \method{trace_list}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog object} 14 | } 15 | \description{ 16 | Construct trace list 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Construct trace list for event log 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /man/bupaR.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/bupar.R 3 | \docType{package} 4 | \name{bupaR} 5 | \alias{bupaR} 6 | \alias{bupaR-package} 7 | \title{bupaR - Business Process Analysis in R} 8 | \description{ 9 | Functionalities for process analysis in R. This packages implements an S3-class for event log objects, and related handler functions. Imports related packages for subsetting event data, computation of descriptive statistics, handling of Petri Net objects and visualization of process maps. 10 | } 11 | -------------------------------------------------------------------------------- /man/case_labels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cases.r 3 | \name{case_labels} 4 | \alias{case_labels} 5 | \alias{case_labels.eventlog} 6 | \title{Get vector of case labels} 7 | \usage{ 8 | case_labels(eventlog) 9 | 10 | \method{case_labels}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Retrieve a vector containing all unique case labels 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Retrieve case labels from eventlog 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /man/ungroup_eventlog.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/group_by.eventlog.R 3 | \name{ungroup_eventlog} 4 | \alias{ungroup_eventlog} 5 | \alias{ungroup_eventlog.eventlog} 6 | \title{Ungroup event log} 7 | \usage{ 8 | ungroup_eventlog(eventlog) 9 | 10 | \method{ungroup_eventlog}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Remove groups from event log 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Remove groups from event log 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /man/group_by_case.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/group_by.eventlog.R 3 | \name{group_by_case} 4 | \alias{group_by_case} 5 | \alias{group_by_case.eventlog} 6 | \title{Group event log on case id} 7 | \usage{ 8 | group_by_case(eventlog) 9 | 10 | \method{group_by_case}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Group an event log by case identifier 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Group eventlog on case identifier 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /man/activity_labels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/activities.R 3 | \name{activity_labels} 4 | \alias{activity_labels} 5 | \alias{activity_labels.eventlog} 6 | \title{Get vector of activity labels} 7 | \usage{ 8 | activity_labels(eventlog) 9 | 10 | \method{activity_labels}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Retrieve a vector containing all unique activity labels 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Retrieve activity labels from eventlog 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /man/resource_labels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/resources.R 3 | \name{resource_labels} 4 | \alias{resource_labels} 5 | \alias{resource_labels.eventlog} 6 | \title{Get vector of resource labels} 7 | \usage{ 8 | resource_labels(eventlog) 9 | 10 | \method{resource_labels}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Retrieve a vector containing all unique resource labels 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Retrieve resource labels from eventlog 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /man/group_by_activity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/group_by.eventlog.R 3 | \name{group_by_activity} 4 | \alias{group_by_activity} 5 | \alias{group_by_activity.eventlog} 6 | \title{Group event log on activity id} 7 | \usage{ 8 | group_by_activity(eventlog) 9 | 10 | \method{group_by_activity}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Group an event log by activity identifier 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Group eventlog on activity identifier 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /man/group_by_resource.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/group_by.eventlog.R 3 | \name{group_by_resource} 4 | \alias{group_by_resource} 5 | \alias{group_by_resource.eventlog} 6 | \title{Group event log on resource id} 7 | \usage{ 8 | group_by_resource(eventlog) 9 | 10 | \method{group_by_resource}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Group an event log by resource identifier 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Group eventlog on resource identifier 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /tests/testthat/test_slice.R: -------------------------------------------------------------------------------- 1 | 2 | library(bupaR) 3 | 4 | context("Slice eventlog") 5 | 6 | test_that("slice returns eventlog", { 7 | expect_s3_class(slice(patients, (sample(size = 1, 1:n_cases(patients))):(sample(size = 1, 1:n_cases(patients)))), "eventlog") 8 | expect_s3_class(slice(sepsis, (sample(size = 1, 1:n_cases(sepsis))):(sample(size = 1, 1:n_cases(sepsis)))), "eventlog") 9 | }) 10 | 11 | test_that("slice returns eventlog with correct amount of cases", { 12 | selection <- (sample(size = 1, 1:n_cases(patients))):(sample(size = 1, 1:n_cases(patients))) 13 | expect_equal(n_cases(slice(patients, selection)), length(selection)) 14 | }) 15 | -------------------------------------------------------------------------------- /man/summary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/summary.eventlog.R 3 | \name{summary.eventlog} 4 | \alias{summary.eventlog} 5 | \alias{summary.grouped_eventlog} 6 | \title{Generic summary function for eventlog class} 7 | \usage{ 8 | \method{summary}{eventlog}(object, ...) 9 | 10 | \method{summary}{grouped_eventlog}(object, ...) 11 | } 12 | \arguments{ 13 | \item{object}{Eventlog object} 14 | 15 | \item{...}{Additional Arguments} 16 | } 17 | \description{ 18 | Generic summary function for eventlog class 19 | } 20 | \section{Methods (by class)}{ 21 | \itemize{ 22 | \item \code{grouped_eventlog}: Summary of grouped event log 23 | }} 24 | 25 | -------------------------------------------------------------------------------- /R/lifecycle_id.R: -------------------------------------------------------------------------------- 1 | #' @title Life cycle classifier 2 | #' @description Get the life_cycle_id of an object of class \code{eventlog} 3 | #' @param x An \code{eventlog} of \code{eventlog_mapping} 4 | #' @family Eventlog classifiers 5 | #' @export lifecycle_id 6 | lifecycle_id <- function(x) { 7 | UseMethod("lifecycle_id") 8 | } 9 | 10 | #' @describeIn lifecycle_id Retrieve lifecycle identifier from eventlog 11 | #' @export 12 | lifecycle_id.eventlog <- function(x) { 13 | return(attr(x, "lifecycle_id")) 14 | } 15 | #' @describeIn lifecycle_id Retrieve lifecycle identifier from eventlog mapping 16 | #' @export 17 | lifecycle_id.eventlog_mapping <- function(x) { 18 | return(x$lifecycle_id) 19 | } 20 | -------------------------------------------------------------------------------- /R/case_id.r: -------------------------------------------------------------------------------- 1 | #' @title Case classifier 2 | #' @description Get the case classifier of an object of class \code{eventlog} 3 | #' @param x An \code{eventlog} of \code{eventlog_mapping} 4 | #' 5 | #' @seealso \code{\link{eventlog}}, \code{\link{mapping}} 6 | #' @family Eventlog classifiers 7 | #' @export case_id 8 | case_id <- function(x){ 9 | UseMethod("case_id") 10 | } 11 | # 12 | #' @describeIn case_id Retrieve case identifier from eventlog 13 | #' @export 14 | case_id.eventlog <- function(x) { 15 | return(attr(x, "case_id")) 16 | } 17 | #' @describeIn case_id Retrieve case identifier from eventlog mapping 18 | #' @export 19 | case_id.eventlog_mapping <- function(x) { 20 | return(x$case_id) 21 | } 22 | -------------------------------------------------------------------------------- /man/group_by_activity_instance.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/group_by.eventlog.R 3 | \name{group_by_activity_instance} 4 | \alias{group_by_activity_instance} 5 | \alias{group_by_activity_instance.eventlog} 6 | \title{Group event log on activity instance id} 7 | \usage{ 8 | group_by_activity_instance(eventlog) 9 | 10 | \method{group_by_activity_instance}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Group an event log by activity instance identifier 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Group eventlog on activity instance identifier 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /R/timestamp.R: -------------------------------------------------------------------------------- 1 | #' @title Timestamp classifier 2 | #' @description Get the timestamp classifier of an object of class \code{eventlog} 3 | #' @param x An \code{eventlog} of \code{eventlog_mapping} 4 | #' @seealso \code{\link{eventlog}}, \code{\link{mapping}} 5 | #' @family Eventlog classifiers 6 | #' @export 7 | timestamp <- function(x) { 8 | UseMethod("timestamp") 9 | } 10 | #' @describeIn timestamp Retrieve timestamp identifier from eventlog 11 | #' @export 12 | timestamp.eventlog <- function(x){ 13 | return(attr(x, "timestamp")) 14 | } 15 | #' @describeIn timestamp Retrieve timestamp identifier from eventlog mapping 16 | #' @export 17 | timestamp.eventlog_mapping <- function(x) { 18 | return(x$timestamp) 19 | } 20 | -------------------------------------------------------------------------------- /R/filter_attributes.R: -------------------------------------------------------------------------------- 1 | #' @title Generic filter function for eventlog 2 | #' @description Generic filter function for eventlog 3 | #' @param eventlog Eventlog object 4 | #' @param ... Filter conditions 5 | #' @export 6 | filter_attributes <- function(eventlog, ...) { 7 | UseMethod("filter_attributes") 8 | } 9 | 10 | #' @describeIn filter_attributes Filter eventlog using attributes 11 | #' @export 12 | 13 | filter_attributes.eventlog <- function(eventlog, ...) { 14 | filter(eventlog, ...) 15 | 16 | } 17 | 18 | #' @describeIn filter_attributes Filter grouped eventlog using attributes 19 | #' @export 20 | 21 | filter_attributes.grouped_eventlog <- function(eventlog, ...) { 22 | filter(eventlog, ...) 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /man/cases.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cases.r 3 | \name{cases} 4 | \alias{cases} 5 | \alias{cases.eventlog} 6 | \title{Cases} 7 | \usage{ 8 | cases(eventlog) 9 | 10 | \method{cases}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{An eventlog object. 14 | \code{eventlog}.} 15 | } 16 | \description{ 17 | Provides a fine-grained summary of an event log with characteristics for each case: the number of events, 18 | the number of activity types, the timespan, the trace, the duration and the first and last event type. 19 | } 20 | \section{Methods (by class)}{ 21 | \itemize{ 22 | \item \code{eventlog}: Constructy list of cases in an eventlog 23 | }} 24 | 25 | -------------------------------------------------------------------------------- /man/group_by_resource_activity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/group_by.eventlog.R 3 | \name{group_by_resource_activity} 4 | \alias{group_by_resource_activity} 5 | \alias{group_by_resource_activity.eventlog} 6 | \title{Group event log on resource and activity id} 7 | \usage{ 8 | group_by_resource_activity(eventlog) 9 | 10 | \method{group_by_resource_activity}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{Eventlog} 14 | } 15 | \description{ 16 | Group an event log by resource and activity identifier 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Group an event log by resource and activity identifier 21 | }} 22 | 23 | -------------------------------------------------------------------------------- /R/n_events.R: -------------------------------------------------------------------------------- 1 | #' @title n_events 2 | #' 3 | #' @description Returns the number of events in an event log 4 | #' @param eventlog The event log to be used. An object of class 5 | #' \code{eventlog}. 6 | #' @family Eventlog count functions 7 | #' @export 8 | 9 | n_events <- function(eventlog) { 10 | UseMethod("n_events") 11 | } 12 | 13 | 14 | #' @describeIn n_events Count number of resources in eventlog 15 | #' @export 16 | 17 | n_events.eventlog <- function(eventlog) { 18 | return(nrow(eventlog)) 19 | } 20 | 21 | #' @describeIn n_events Count number of resource in eventlog 22 | #' @export 23 | n_events.grouped_eventlog <- function(eventlog) { 24 | eventlog %>% 25 | summarize(n_events = n()) %>% 26 | return() 27 | } 28 | 29 | -------------------------------------------------------------------------------- /R/resource_id.R: -------------------------------------------------------------------------------- 1 | #' @title Resource classifier 2 | #' @description Get the resource classifier of an object of class \code{eventlog}. 3 | #' @param x An \code{eventlog} of \code{eventlog_mapping} 4 | #' @seealso \code{\link{eventlog}}, \code{\link{mapping}} 5 | #' @family Eventlog classifiers 6 | #' @export 7 | 8 | resource_id <- function(x) { 9 | UseMethod("resource_id") 10 | } 11 | 12 | #' @describeIn resource_id Retrieve resource identifier from eventlog 13 | #' @export 14 | resource_id.eventlog <- function(x) { 15 | return(attr(x, "resource_id")) 16 | } 17 | #' @describeIn resource_id Retrieve resource identifier from eventlog mapping 18 | #' @export 19 | resource_id.eventlog_mapping <- function(x) { 20 | return(x$resource_id) 21 | } 22 | -------------------------------------------------------------------------------- /R/activity_id.R: -------------------------------------------------------------------------------- 1 | #' @title Activity classifier 2 | #' @description Get the activity classifier of an object of class \code{eventlog}. 3 | #' @param x An \code{eventlog} of \code{eventlog_mapping} 4 | #' @seealso \code{\link{eventlog}}, \code{\link{mapping}} 5 | #' @family Eventlog classifiers 6 | #' @export activity_id 7 | activity_id <- function(x) { 8 | UseMethod("activity_id") 9 | } 10 | 11 | #' @describeIn activity_id Retrieve activity identifier from eventlog 12 | #' @export 13 | activity_id.eventlog <- function(x){ 14 | return(attr(x, "activity_id")) 15 | } 16 | #' @describeIn activity_id Retrieve activity identifier from eventlog mapping 17 | #' @export 18 | activity_id.eventlog_mapping <- function(x) { 19 | return(x$activity_id) 20 | } 21 | 22 | -------------------------------------------------------------------------------- /R/mutate.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Mutate event log 2 | #' @param .data Eventlog 3 | #' @param ... New variables 4 | #' @name mutate 5 | #' @importFrom dplyr mutate 6 | #' @export 7 | dplyr::mutate 8 | #' @describeIn mutate Mutate eventlog 9 | #' @export 10 | mutate.eventlog <- function(.data, ...) { 11 | mapping <- mapping(.data) 12 | x <- NextMethod(.data, ...) 13 | x %>% 14 | re_map(mapping) -> x 15 | return(x) 16 | 17 | } 18 | 19 | #' @describeIn mutate Mutate grouped eventlog 20 | #' @export 21 | 22 | mutate.grouped_eventlog <- function(.data, ...) { 23 | mapping <- mapping(.data) 24 | groups <- groups(.data) 25 | x <- NextMethod(.data, ...) 26 | x <- re_map(x, mapping) 27 | x <- group_by_at(x, vars(one_of(paste(groups)))) 28 | return(x) 29 | 30 | } 31 | -------------------------------------------------------------------------------- /man/last_n.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/last_n.R 3 | \name{last_n} 4 | \alias{last_n} 5 | \alias{last_n.eventlog} 6 | \alias{last_n.grouped_eventlog} 7 | \title{Select last n activity instances} 8 | \usage{ 9 | last_n(eventlog, n) 10 | 11 | \method{last_n}{eventlog}(eventlog, n) 12 | 13 | \method{last_n}{grouped_eventlog}(eventlog, n) 14 | } 15 | \arguments{ 16 | \item{eventlog}{Eventlog object} 17 | 18 | \item{n}{Integer value} 19 | } 20 | \description{ 21 | Select last n activity instances 22 | } 23 | \section{Methods (by class)}{ 24 | \itemize{ 25 | \item \code{eventlog}: Select first n activity instances in event log 26 | 27 | \item \code{grouped_eventlog}: Select first n activity instances in grouped event log 28 | }} 29 | 30 | -------------------------------------------------------------------------------- /R/fill.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Fill event log 2 | #' @param .data Eventlog 3 | #' @param ... options for fill 4 | #' @name fill 5 | #' @importFrom tidyr fill 6 | #' @export 7 | tidyr::fill 8 | #' @describeIn fill Fill eventlog 9 | #' @export 10 | fill.eventlog <- function(data, ..., .direction) { 11 | mapping <- mapping(data) 12 | x <- NextMethod(data, ..., .direction) 13 | x %>% 14 | re_map(mapping) -> x 15 | return(x) 16 | 17 | } 18 | 19 | #' @describeIn fill Fill grouped eventlog 20 | #' @export 21 | 22 | fill.grouped_eventlog <- function(data, ..., .direction) { 23 | mapping <- mapping(data) 24 | groups <- groups(data) 25 | x <- NextMethod(data, ..., .direction) 26 | x <- re_map(x, mapping) 27 | x <- group_by_at(x, vars(one_of(paste(groups)))) 28 | return(x) 29 | 30 | } 31 | -------------------------------------------------------------------------------- /man/slice_events.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/slice.eventlog.R 3 | \name{slice_events} 4 | \alias{slice_events} 5 | \alias{slice_events.eventlog} 6 | \alias{slice_events.grouped_eventlog} 7 | \title{Slice Events} 8 | \usage{ 9 | slice_events(.data, ...) 10 | 11 | \method{slice_events}{eventlog}(.data, ...) 12 | 13 | \method{slice_events}{grouped_eventlog}(.data, ...) 14 | } 15 | \arguments{ 16 | \item{.data}{Eventlog} 17 | 18 | \item{...}{Slice index} 19 | } 20 | \description{ 21 | Take a slice of events from event log 22 | } 23 | \section{Methods (by class)}{ 24 | \itemize{ 25 | \item \code{eventlog}: Take a slice of events from event log 26 | 27 | \item \code{grouped_eventlog}: Take a slice of events from grouped event log 28 | }} 29 | 30 | -------------------------------------------------------------------------------- /R/activity_instance_id.R: -------------------------------------------------------------------------------- 1 | #' @title Activity instance classifier 2 | #' @description Get the activity instance classifier of an object of class \code{eventlog}. 3 | #' @param x An \code{eventlog} of \code{eventlog_mapping} 4 | #' @family Eventlog classifiers 5 | #' @export 6 | activity_instance_id <- function(x){ 7 | UseMethod("activity_instance_id") 8 | } 9 | #' @describeIn activity_instance_id Retrieve activity instance identifier from eventlog 10 | #' @export 11 | 12 | activity_instance_id.eventlog <- function(x){ 13 | return(attr(x, "activity_instance_id")) 14 | } 15 | 16 | #' @describeIn activity_instance_id Retrieve activity instance identifier from eventlog mapping 17 | #' @export 18 | 19 | activity_instance_id.eventlog_mapping <- function(x){ 20 | return(x$activity_instance_id) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /man/first_n.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/first_n.R 3 | \name{first_n} 4 | \alias{first_n} 5 | \alias{first_n.eventlog} 6 | \alias{first_n.grouped_eventlog} 7 | \title{Select first n activity instances} 8 | \usage{ 9 | first_n(eventlog, n) 10 | 11 | \method{first_n}{eventlog}(eventlog, n) 12 | 13 | \method{first_n}{grouped_eventlog}(eventlog, n) 14 | } 15 | \arguments{ 16 | \item{eventlog}{Eventlog object} 17 | 18 | \item{n}{Integer value} 19 | } 20 | \description{ 21 | Select first n activity instances 22 | } 23 | \section{Methods (by class)}{ 24 | \itemize{ 25 | \item \code{eventlog}: Select first n activity instances in event log 26 | 27 | \item \code{grouped_eventlog}: Select first n activity instances in grouped event log 28 | }} 29 | 30 | -------------------------------------------------------------------------------- /man/group_by.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/group_by.eventlog.R 3 | \docType{import} 4 | \name{group_by} 5 | \alias{group_by} 6 | \alias{group_by.eventlog} 7 | \title{Group event log} 8 | \usage{ 9 | \method{group_by}{eventlog}(.data, ..., add = F) 10 | } 11 | \arguments{ 12 | \item{.data}{Eventlog} 13 | 14 | \item{...}{Variables to group by} 15 | 16 | \item{add}{Add grouping variables to existing ones} 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Group eventlog 21 | }} 22 | 23 | \keyword{internal} 24 | \description{ 25 | These objects are imported from other packages. Follow the links 26 | below to see their documentation. 27 | 28 | \describe{ 29 | \item{dplyr}{\code{\link[dplyr]{group_by}}} 30 | }} 31 | 32 | -------------------------------------------------------------------------------- /R/arrange.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Arrange event log 2 | #' @name arrange 3 | #' @param .data Eventlog 4 | #' @param ... Variables to arrange on 5 | #' @importFrom dplyr arrange 6 | #' @export 7 | dplyr::arrange 8 | #' @describeIn arrange Arrange an eventlog 9 | #' @export 10 | arrange.eventlog <- function(.data, ..., add = F) { 11 | 12 | mapping <- mapping(.data) 13 | x <- NextMethod(.data, ...) 14 | x <- re_map(x, mapping) 15 | 16 | return(x) 17 | 18 | } 19 | #' @describeIn arrange Arrange an eventlog by group, maintaining all groups 20 | #' @export 21 | #' 22 | arrange.grouped_eventlog <- function(.data, ..., add = F) { 23 | mapping <- mapping(.data) 24 | groups <- groups(.data) 25 | x <- NextMethod(.data, ...) 26 | x <- re_map(x, mapping) 27 | x <- group_by_at(x, vars(one_of(paste(groups)))) 28 | return(x) 29 | } 30 | -------------------------------------------------------------------------------- /R/filter.R: -------------------------------------------------------------------------------- 1 | #' @title Filter event log 2 | #' @name filter 3 | #' @param .data Eventlog 4 | #' @param ... Conditions to filter 5 | #' @importFrom dplyr filter 6 | #' @export 7 | dplyr::filter 8 | 9 | #' @describeIn filter Filter eventlog 10 | #' @export 11 | filter.eventlog <- function(.data, ...) { 12 | mapping <- mapping(.data) 13 | .data %>% 14 | as.data.frame() %>% 15 | dplyr::filter(...) %>% 16 | re_map(mapping) %>% 17 | return() 18 | } 19 | #' @describeIn filter Filter eventlog 20 | #' @export 21 | 22 | filter.grouped_eventlog <- function(.data, ...) { 23 | groups <- groups(.data) 24 | mapping <- mapping(.data) 25 | .data %>% 26 | nest() %>% 27 | mutate(data = map(data, dplyr::filter, ...)) %>% 28 | unnest() %>% 29 | re_map(mapping) %>% 30 | group_by_at(vars(one_of(paste(groups)))) 31 | 32 | } 33 | -------------------------------------------------------------------------------- /R/print.mapping.R: -------------------------------------------------------------------------------- 1 | #' @title Generic print function for eventlog_mapping 2 | #' @description Generic print function for eventlog_mapping 3 | #' @param x Eventlog mapping object 4 | #' @param ... Additional Arguments 5 | #' @method print eventlog_mapping 6 | #' @export 7 | 8 | print.eventlog_mapping <- function(x, ...) { 9 | mapping <- x 10 | 11 | cat(paste0("Case identifier:\t\t", mapping$case_identifier),"\n") 12 | cat(paste0("Activity identifier:\t\t", mapping$activity_identifier),"\n") 13 | cat(paste0("Resource identifier:\t\t", mapping$resource_identifier),"\n") 14 | cat(paste0("Activity instance identifier:\t", mapping$activity_instance_identifier),"\n") 15 | cat(paste0("Timestamp:\t\t\t", mapping$timestamp_identifier),"\n") 16 | cat(paste0("Lifecycle transition:\t\t", mapping$lifecycle_identifier),"\n") 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /R/re_map.R: -------------------------------------------------------------------------------- 1 | #' @title Re map 2 | #' 3 | #' @description Construct and eventlog using an existing mapping. 4 | #' 5 | #' @param eventlog The event log data to be used. 6 | #' 7 | #' @param eventlog_mapping An existing eventlog mapping created by the mapping function 8 | #' 9 | #' @export re_map 10 | re_map <- function(eventlog, eventlog_mapping) { 11 | stopifnot("eventlog_mapping" %in% class(eventlog_mapping)) 12 | eventlog(eventlog, 13 | case_id = eventlog_mapping$case_identifier, 14 | activity_id = eventlog_mapping$activity_identifier, 15 | activity_instance_id = eventlog_mapping$activity_instance_identifier, 16 | lifecycle_id = eventlog_mapping$lifecycle_identifier, 17 | timestamp = eventlog_mapping$timestamp_identifier, 18 | resource_id = eventlog_mapping$resource_identifier, 19 | order = ".order") 20 | } 21 | -------------------------------------------------------------------------------- /man/mapping.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mapping.R 3 | \name{mapping} 4 | \alias{mapping} 5 | \alias{mapping.eventlog} 6 | \title{Mapping} 7 | \usage{ 8 | mapping(eventlog) 9 | 10 | \method{mapping}{eventlog}(eventlog) 11 | } 12 | \arguments{ 13 | \item{eventlog}{The event log to be used. An object of class 14 | \code{eventlog}.} 15 | } 16 | \description{ 17 | Prints the mapping of an event log object. 18 | } 19 | \section{Methods (by class)}{ 20 | \itemize{ 21 | \item \code{eventlog}: Retrieve identifier mapping from eventlog 22 | }} 23 | 24 | \seealso{ 25 | Other Eventlog classifiers: \code{\link{activity_id}}, 26 | \code{\link{activity_instance_id}}, 27 | \code{\link{case_id}}, \code{\link{lifecycle_id}}, 28 | \code{\link{resource_id}}, \code{\link{timestamp}} 29 | } 30 | -------------------------------------------------------------------------------- /man/durations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/durations.R 3 | \name{durations} 4 | \alias{durations} 5 | \alias{durations.eventlog} 6 | \title{Durations} 7 | \usage{ 8 | durations(eventlog, units) 9 | 10 | \method{durations}{eventlog}(eventlog, units = "days") 11 | } 12 | \arguments{ 13 | \item{eventlog}{The event log to be used. An object of class 14 | \code{eventlog}.} 15 | 16 | \item{units}{The time unit in which the throughput times should be reported.} 17 | } 18 | \description{ 19 | Computes the throughput times of each case. 20 | Throughput time is defined as the interval between the start of the first event and the completion of the last event. 21 | } 22 | \section{Methods (by class)}{ 23 | \itemize{ 24 | \item \code{eventlog}: Compute durations from eventlog 25 | }} 26 | 27 | -------------------------------------------------------------------------------- /man/select.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/select.R 3 | \docType{import} 4 | \name{select} 5 | \alias{select} 6 | \alias{select.eventlog} 7 | \title{Select event log} 8 | \usage{ 9 | \method{select}{eventlog}(.data, ..., force_df = FALSE) 10 | } 11 | \arguments{ 12 | \item{.data}{Eventlog} 13 | 14 | \item{...}{Bare column names} 15 | 16 | \item{force_df}{If TRUE, result will no longer be a event log when not all id columns are selected.} 17 | } 18 | \section{Methods (by class)}{ 19 | \itemize{ 20 | \item \code{eventlog}: Select eventlog 21 | }} 22 | 23 | \keyword{internal} 24 | \description{ 25 | These objects are imported from other packages. Follow the links 26 | below to see their documentation. 27 | 28 | \describe{ 29 | \item{dplyr}{\code{\link[dplyr]{select}}} 30 | }} 31 | 32 | -------------------------------------------------------------------------------- /R/act_unite.R: -------------------------------------------------------------------------------- 1 | #' @title Unite activity labels 2 | #' @description Recode two or different more activity labels two a uniform activity label 3 | #' @param eventlog An object of class \code{eventlog}. 4 | #' @param ... A series of named character vectors. The activity labels in each vector will be replaced with the name. 5 | #' @seealso \code{\link{eventlog}}, \code{\link{activity_id}}, \code{\link{act_recode}} 6 | #' @family Activity processing functions 7 | #' @export act_unite 8 | act_unite <- function(eventlog, ...) { 9 | UseMethod("act_unite") 10 | } 11 | #' @describeIn act_unite Unite activity labels in event log 12 | #' @export 13 | act_unite.eventlog <- function(eventlog, ...) { 14 | eventlog %>% 15 | mutate(!!activity_id(eventlog) := forcats::fct_collapse((!!as.symbol(activity_id(eventlog))), ...)) %>% 16 | return() 17 | } 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /R/n_traces.R: -------------------------------------------------------------------------------- 1 | #' @title n_traces 2 | #' @description Returns the number of traces in an event log 3 | #' @param eventlog The event log to be used. An object of class 4 | #' \code{eventlog}. 5 | #' @family Eventlog count functions 6 | #' @export n_traces 7 | 8 | n_traces <- function(eventlog) { 9 | UseMethod("n_traces") 10 | } 11 | 12 | #' @describeIn n_traces Count number of traces for eventlog 13 | #' @export 14 | 15 | n_traces.eventlog <- function(eventlog) { 16 | return(nrow(trace_list(eventlog))) 17 | } 18 | 19 | #' @describeIn n_traces Count number of traces for grouped eventlog 20 | #' @export 21 | n_traces.grouped_eventlog <- function(eventlog) { 22 | mapping <- mapping(eventlog) 23 | eventlog %>% 24 | nest %>% 25 | mutate(n_traces = purrr::map_dbl(data, ~n_traces(re_map(.x, mapping)))) %>% 26 | select(-data) %>% 27 | return() 28 | } 29 | 30 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /man/filter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filter.R 3 | \docType{import} 4 | \name{filter} 5 | \alias{filter} 6 | \alias{filter.eventlog} 7 | \alias{filter.grouped_eventlog} 8 | \title{Filter event log} 9 | \usage{ 10 | \method{filter}{eventlog}(.data, ...) 11 | 12 | \method{filter}{grouped_eventlog}(.data, ...) 13 | } 14 | \arguments{ 15 | \item{.data}{Eventlog} 16 | 17 | \item{...}{Conditions to filter} 18 | } 19 | \section{Methods (by class)}{ 20 | \itemize{ 21 | \item \code{eventlog}: Filter eventlog 22 | 23 | \item \code{grouped_eventlog}: Filter eventlog 24 | }} 25 | 26 | \keyword{internal} 27 | \description{ 28 | These objects are imported from other packages. Follow the links 29 | below to see their documentation. 30 | 31 | \describe{ 32 | \item{dplyr}{\code{\link[dplyr]{filter}}} 33 | }} 34 | 35 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: bupaR 2 | Type: Package 3 | Title: Business Process Analysis in R 4 | Version: 0.4.1 5 | Date: 2018-07-01 6 | Authors@R: person("Gert","Janssenswillen", email = "gert.janssenswillen@uhasselt.be", 7 | role = c("aut","cre")) 8 | Description: Comprehensive Business Process Analysis toolkit. Creates S3-class for event log objects, and related handler functions. Imports related packages for filtering event data, computation of descriptive statistics, handling of 'Petri Net' objects and visualization of process maps. See also packages 'edeaR','processmapR', 'eventdataR' and 'processmonitR'. 9 | License: MIT + file LICENSE 10 | Encoding: UTF-8 11 | LazyData: true 12 | RoxygenNote: 6.0.1 13 | Imports: magrittr, dplyr, data.table, shiny, miniUI, purrr, tidyr, glue, forcats, rlang, eventdataR (>= 0.2.0) 14 | URL: https://www.bupar.net 15 | Suggests: testthat 16 | -------------------------------------------------------------------------------- /man/fill.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fill.eventlog.R 3 | \docType{import} 4 | \name{fill} 5 | \alias{fill} 6 | \alias{fill.eventlog} 7 | \alias{fill.grouped_eventlog} 8 | \title{Fill event log} 9 | \usage{ 10 | \method{fill}{eventlog}(data, ..., .direction) 11 | 12 | \method{fill}{grouped_eventlog}(data, ..., .direction) 13 | } 14 | \arguments{ 15 | \item{...}{options for fill} 16 | 17 | \item{.data}{Eventlog} 18 | } 19 | \section{Methods (by class)}{ 20 | \itemize{ 21 | \item \code{eventlog}: Fill eventlog 22 | 23 | \item \code{grouped_eventlog}: Fill grouped eventlog 24 | }} 25 | 26 | \keyword{internal} 27 | \description{ 28 | These objects are imported from other packages. Follow the links 29 | below to see their documentation. 30 | 31 | \describe{ 32 | \item{tidyr}{\code{\link[tidyr]{fill}}} 33 | }} 34 | 35 | -------------------------------------------------------------------------------- /man/mutate.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutate.eventlog.R 3 | \docType{import} 4 | \name{mutate} 5 | \alias{mutate} 6 | \alias{mutate.eventlog} 7 | \alias{mutate.grouped_eventlog} 8 | \title{Mutate event log} 9 | \usage{ 10 | \method{mutate}{eventlog}(.data, ...) 11 | 12 | \method{mutate}{grouped_eventlog}(.data, ...) 13 | } 14 | \arguments{ 15 | \item{.data}{Eventlog} 16 | 17 | \item{...}{New variables} 18 | } 19 | \section{Methods (by class)}{ 20 | \itemize{ 21 | \item \code{eventlog}: Mutate eventlog 22 | 23 | \item \code{grouped_eventlog}: Mutate grouped eventlog 24 | }} 25 | 26 | \keyword{internal} 27 | \description{ 28 | These objects are imported from other packages. Follow the links 29 | below to see their documentation. 30 | 31 | \describe{ 32 | \item{dplyr}{\code{\link[dplyr]{mutate}}} 33 | }} 34 | 35 | -------------------------------------------------------------------------------- /man/slice_activities.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/slice.eventlog.R 3 | \name{slice_activities} 4 | \alias{slice_activities} 5 | \alias{slice_activities.eventlog} 6 | \alias{slice_activities.grouped_eventlog} 7 | \title{Slice Activities} 8 | \usage{ 9 | slice_activities(.data, ...) 10 | 11 | \method{slice_activities}{eventlog}(.data, ...) 12 | 13 | \method{slice_activities}{grouped_eventlog}(.data, ...) 14 | } 15 | \arguments{ 16 | \item{.data}{Eventlog} 17 | 18 | \item{...}{Slice index} 19 | } 20 | \description{ 21 | Take a slice of activity instances from event log 22 | } 23 | \section{Methods (by class)}{ 24 | \itemize{ 25 | \item \code{eventlog}: Take a slice of activity instances from event log 26 | 27 | \item \code{grouped_eventlog}: Take a slice of activity instances from grouped event log 28 | }} 29 | 30 | -------------------------------------------------------------------------------- /man/filter_attributes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filter_attributes.R 3 | \name{filter_attributes} 4 | \alias{filter_attributes} 5 | \alias{filter_attributes.eventlog} 6 | \alias{filter_attributes.grouped_eventlog} 7 | \title{Generic filter function for eventlog} 8 | \usage{ 9 | filter_attributes(eventlog, ...) 10 | 11 | \method{filter_attributes}{eventlog}(eventlog, ...) 12 | 13 | \method{filter_attributes}{grouped_eventlog}(eventlog, ...) 14 | } 15 | \arguments{ 16 | \item{eventlog}{Eventlog object} 17 | 18 | \item{...}{Filter conditions} 19 | } 20 | \description{ 21 | Generic filter function for eventlog 22 | } 23 | \section{Methods (by class)}{ 24 | \itemize{ 25 | \item \code{eventlog}: Filter eventlog using attributes 26 | 27 | \item \code{grouped_eventlog}: Filter grouped eventlog using attributes 28 | }} 29 | 30 | -------------------------------------------------------------------------------- /R/n_cases.R: -------------------------------------------------------------------------------- 1 | #' @title n_cases 2 | #' 3 | #' @description Returns the number of cases in an event log 4 | #' 5 | #' @param eventlog The event log to be used. An object of class 6 | #' \code{eventlog}. 7 | #' @family Eventlog count functions 8 | #' @export 9 | 10 | n_cases <- function(eventlog) { 11 | UseMethod("n_cases") 12 | } 13 | 14 | 15 | #' @describeIn n_cases Count number of cases for eventlog 16 | #' @export 17 | 18 | n_cases.eventlog <- function(eventlog) { 19 | colnames(eventlog)[colnames(eventlog) == case_id(eventlog)] <- "case_classifier" 20 | return(length(unique(eventlog$case_classifier))) 21 | } 22 | 23 | #' @describeIn n_cases Count number of cases for grouped eventlog 24 | #' @export 25 | n_cases.grouped_eventlog <- function(eventlog) { 26 | eventlog %>% 27 | summarize(n_cases = n_distinct(!!as.symbol(case_id(eventlog)))) %>% 28 | return() 29 | } 30 | 31 | -------------------------------------------------------------------------------- /man/n_activity_instances.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/n_activity_instances.R 3 | \name{n_activity_instances} 4 | \alias{n_activity_instances} 5 | \alias{n_activity_instances.eventlog} 6 | \alias{n_activity_instances.grouped_eventlog} 7 | \title{n_activity_instances} 8 | \usage{ 9 | n_activity_instances(eventlog) 10 | 11 | \method{n_activity_instances}{eventlog}(eventlog) 12 | 13 | \method{n_activity_instances}{grouped_eventlog}(eventlog) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | } 19 | \description{ 20 | Returns the number of activity instances in an event log 21 | } 22 | \seealso{ 23 | Other Eventlog count functions: \code{\link{n_activities}}, 24 | \code{\link{n_cases}}, \code{\link{n_events}}, 25 | \code{\link{n_resources}}, \code{\link{n_traces}} 26 | } 27 | -------------------------------------------------------------------------------- /man/activities_to_eventlog.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/activities_to_eventlog.R 3 | \name{activities_to_eventlog} 4 | \alias{activities_to_eventlog} 5 | \title{Create event log from list of activity instances} 6 | \usage{ 7 | activities_to_eventlog(activity_log, case_id, activity_id, resource_id, 8 | timestamps) 9 | } 10 | \arguments{ 11 | \item{activity_log}{A data.frame where each row is an activity instances} 12 | 13 | \item{case_id}{Column name of the case identifier} 14 | 15 | \item{activity_id}{Column name of the activity identifier} 16 | 17 | \item{resource_id}{Column name of the resource identifier} 18 | 19 | \item{timestamps}{A vector of column names containing different timestamp. To column names will be transformed to lifecycle identifiers} 20 | } 21 | \description{ 22 | Create event log from list of activity instances 23 | } 24 | -------------------------------------------------------------------------------- /R/act_recode.R: -------------------------------------------------------------------------------- 1 | #' @title Recode activity labels 2 | #' @description Recode one or more activity labels through specifying their old and new label 3 | #' @param eventlog An object of class \code{eventlog}. 4 | #' @param ... A sequence of named character vectors of length one where the names gives the new label and the value gives the old label. Labels not mentioned will be left unchanged. 5 | #' @seealso \code{\link{eventlog}}, \code{\link{activity_id}}, \code{\link{act_unite}} 6 | #' @family Activity processing functions 7 | #' @export act_recode 8 | act_recode <- function(eventlog, ...) { 9 | UseMethod("act_recode") 10 | } 11 | #' @describeIn act_recode Recode activity labels of event log 12 | #' @export 13 | act_recode.eventlog <- function(eventlog, ...) { 14 | eventlog %>% 15 | mutate(!!as.symbol(activity_id(eventlog)) := forcats::fct_recode((!!as.symbol(activity_id(eventlog))), ...)) %>% 16 | return() 17 | } 18 | -------------------------------------------------------------------------------- /man/slice.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/slice.eventlog.R 3 | \docType{import} 4 | \name{slice} 5 | \alias{slice} 6 | \alias{slice.eventlog} 7 | \alias{slice.grouped_eventlog} 8 | \title{Slice function for event log} 9 | \usage{ 10 | \method{slice}{eventlog}(.data, ...) 11 | 12 | \method{slice}{grouped_eventlog}(.data, ...) 13 | } 14 | \arguments{ 15 | \item{.data}{Eventlog} 16 | 17 | \item{...}{Additional Arguments} 18 | } 19 | \section{Methods (by class)}{ 20 | \itemize{ 21 | \item \code{eventlog}: Slice n cases of an eventlog 22 | 23 | \item \code{grouped_eventlog}: Slice grouped eventlog: take slice of cases from each group. 24 | }} 25 | 26 | \keyword{internal} 27 | \description{ 28 | These objects are imported from other packages. Follow the links 29 | below to see their documentation. 30 | 31 | \describe{ 32 | \item{dplyr}{\code{\link[dplyr]{slice}}} 33 | }} 34 | 35 | -------------------------------------------------------------------------------- /R/n_resources.R: -------------------------------------------------------------------------------- 1 | #' @title n_resources 2 | #' 3 | #' @description Returns the number of resources in an event log 4 | #' @param eventlog The event log to be used. An object of class 5 | #' \code{eventlog}. 6 | #' @family Eventlog count functions 7 | #' @export 8 | 9 | n_resources <- function(eventlog) { 10 | UseMethod("n_resources") 11 | } 12 | 13 | 14 | #' @describeIn n_resources Count number of resources in eventlog 15 | #' @export 16 | 17 | n_resources.eventlog <- function(eventlog) { 18 | colnames(eventlog)[colnames(eventlog) == resource_id(eventlog)] <- "resource_classifier" 19 | return(length(unique(eventlog$resource_classifier))) 20 | } 21 | 22 | #' @describeIn n_resources Count number of resources in grouped eventlog 23 | #' @export 24 | n_resources.grouped_eventlog <- function(eventlog) { 25 | eventlog %>% 26 | summarize(n_resources = n_distinct(!!as.symbol(resource_id(eventlog)))) %>% 27 | return() 28 | } 29 | 30 | -------------------------------------------------------------------------------- /man/arrange.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/arrange.eventlog.R 3 | \docType{import} 4 | \name{arrange} 5 | \alias{arrange} 6 | \alias{arrange.eventlog} 7 | \alias{arrange.grouped_eventlog} 8 | \title{Arrange event log} 9 | \usage{ 10 | \method{arrange}{eventlog}(.data, ..., add = F) 11 | 12 | \method{arrange}{grouped_eventlog}(.data, ..., add = F) 13 | } 14 | \arguments{ 15 | \item{.data}{Eventlog} 16 | 17 | \item{...}{Variables to arrange on} 18 | } 19 | \section{Methods (by class)}{ 20 | \itemize{ 21 | \item \code{eventlog}: Arrange an eventlog 22 | 23 | \item \code{grouped_eventlog}: Arrange an eventlog by group, maintaining all groups 24 | }} 25 | 26 | \keyword{internal} 27 | \description{ 28 | These objects are imported from other packages. Follow the links 29 | below to see their documentation. 30 | 31 | \describe{ 32 | \item{dplyr}{\code{\link[dplyr]{arrange}}} 33 | }} 34 | 35 | -------------------------------------------------------------------------------- /man/resources.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/resources.R 3 | \name{resources} 4 | \alias{resources} 5 | \alias{resources.eventlog} 6 | \alias{resources.grouped_eventlog} 7 | \title{Resources} 8 | \usage{ 9 | resources(eventlog) 10 | 11 | \method{resources}{eventlog}(eventlog) 12 | 13 | \method{resources}{grouped_eventlog}(eventlog) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | } 19 | \description{ 20 | Returns a \code{tbl_df} containing a list of all resources in the event log, with there absolute and relative frequency 21 | } 22 | \section{Methods (by class)}{ 23 | \itemize{ 24 | \item \code{eventlog}: Generate resource list for eventlog 25 | 26 | \item \code{grouped_eventlog}: Generate resource list for grouped eventlog 27 | }} 28 | 29 | \seealso{ 30 | \code{\link{resource_id}}, \code{\link{eventlog}} 31 | } 32 | -------------------------------------------------------------------------------- /R/mapping.R: -------------------------------------------------------------------------------- 1 | #' @title Mapping 2 | #' 3 | #' @description Prints the mapping of an event log object. 4 | #' 5 | #' @param eventlog The event log to be used. An object of class 6 | #' \code{eventlog}. 7 | #' @family Eventlog classifiers 8 | #' @export 9 | mapping <- function(eventlog) { 10 | UseMethod("mapping") 11 | } 12 | #' @describeIn mapping Retrieve identifier mapping from eventlog 13 | #' @export 14 | mapping.eventlog <- function(eventlog) { 15 | mapping <- list() 16 | 17 | mapping$case_identifier <- case_id(eventlog) 18 | mapping$activity_identifier <- activity_id(eventlog) 19 | mapping$activity_instance_identifier <- activity_instance_id(eventlog) 20 | mapping$timestamp_identifier <- timestamp(eventlog) 21 | mapping$lifecycle_identifier <- lifecycle_id(eventlog) 22 | mapping$resource_identifier <- resource_id(eventlog) 23 | 24 | class(mapping) <- c("eventlog_mapping",class(mapping)) 25 | 26 | return(mapping) 27 | } 28 | 29 | -------------------------------------------------------------------------------- /man/act_unite.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/act_unite.R 3 | \name{act_unite} 4 | \alias{act_unite} 5 | \alias{act_unite.eventlog} 6 | \title{Unite activity labels} 7 | \usage{ 8 | act_unite(eventlog, ...) 9 | 10 | \method{act_unite}{eventlog}(eventlog, ...) 11 | } 12 | \arguments{ 13 | \item{eventlog}{An object of class \code{eventlog}.} 14 | 15 | \item{...}{A series of named character vectors. The activity labels in each vector will be replaced with the name.} 16 | } 17 | \description{ 18 | Recode two or different more activity labels two a uniform activity label 19 | } 20 | \section{Methods (by class)}{ 21 | \itemize{ 22 | \item \code{eventlog}: Unite activity labels in event log 23 | }} 24 | 25 | \seealso{ 26 | \code{\link{eventlog}}, \code{\link{activity_id}}, \code{\link{act_recode}} 27 | 28 | Other Activity processing functions: \code{\link{act_collapse}}, 29 | \code{\link{act_recode}} 30 | } 31 | -------------------------------------------------------------------------------- /R/n_activities.R: -------------------------------------------------------------------------------- 1 | #' @title n_activities 2 | #' 3 | #' @description Returns the number of activities in an event log 4 | #' 5 | #' @param eventlog The event log to be used. An object of class 6 | #' \code{eventlog}. 7 | #' @family Eventlog count functions 8 | #' @export 9 | 10 | n_activities <- function(eventlog) { 11 | UseMethod("n_activities") 12 | } 13 | 14 | #' @describeIn n_activities Count the number of activities in an event log 15 | #' @export 16 | 17 | 18 | n_activities.eventlog <- function(eventlog){ 19 | colnames(eventlog)[colnames(eventlog) == activity_id(eventlog)] <- "event_classifier" 20 | return(length(unique(eventlog$event_classifier))) 21 | } 22 | 23 | #' @describeIn n_activities Count the number of activities for a grouped event log 24 | #' @export 25 | n_activities.grouped_eventlog <- function(eventlog) { 26 | eventlog %>% 27 | summarize(n_activities = n_distinct(!!as.symbol(activity_id(eventlog)))) %>% 28 | return() 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /man/n_cases.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/n_cases.R 3 | \name{n_cases} 4 | \alias{n_cases} 5 | \alias{n_cases.eventlog} 6 | \alias{n_cases.grouped_eventlog} 7 | \title{n_cases} 8 | \usage{ 9 | n_cases(eventlog) 10 | 11 | \method{n_cases}{eventlog}(eventlog) 12 | 13 | \method{n_cases}{grouped_eventlog}(eventlog) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | } 19 | \description{ 20 | Returns the number of cases in an event log 21 | } 22 | \section{Methods (by class)}{ 23 | \itemize{ 24 | \item \code{eventlog}: Count number of cases for eventlog 25 | 26 | \item \code{grouped_eventlog}: Count number of cases for grouped eventlog 27 | }} 28 | 29 | \seealso{ 30 | Other Eventlog count functions: \code{\link{n_activities}}, 31 | \code{\link{n_activity_instances}}, 32 | \code{\link{n_events}}, \code{\link{n_resources}}, 33 | \code{\link{n_traces}} 34 | } 35 | -------------------------------------------------------------------------------- /man/activities.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/activities.R 3 | \name{activities} 4 | \alias{activities} 5 | \alias{activities.eventlog} 6 | \alias{activities.grouped_eventlog} 7 | \title{Activities} 8 | \usage{ 9 | activities(eventlog) 10 | 11 | \method{activities}{eventlog}(eventlog) 12 | 13 | \method{activities}{grouped_eventlog}(eventlog) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | } 19 | \description{ 20 | Returns a \code{tbl_df} containing a list of all activity types in the event log, with their absolute and relative frequency 21 | } 22 | \section{Methods (by class)}{ 23 | \itemize{ 24 | \item \code{eventlog}: Generate activity list for eventlog 25 | 26 | \item \code{grouped_eventlog}: Generate activity list for grouped eventlog 27 | }} 28 | 29 | \seealso{ 30 | \code{\link{activity_id}},\code{\link{activity_instance_id}}, \code{\link{eventlog}} 31 | } 32 | -------------------------------------------------------------------------------- /man/n_events.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/n_events.R 3 | \name{n_events} 4 | \alias{n_events} 5 | \alias{n_events.eventlog} 6 | \alias{n_events.grouped_eventlog} 7 | \title{n_events} 8 | \usage{ 9 | n_events(eventlog) 10 | 11 | \method{n_events}{eventlog}(eventlog) 12 | 13 | \method{n_events}{grouped_eventlog}(eventlog) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | } 19 | \description{ 20 | Returns the number of events in an event log 21 | } 22 | \section{Methods (by class)}{ 23 | \itemize{ 24 | \item \code{eventlog}: Count number of resources in eventlog 25 | 26 | \item \code{grouped_eventlog}: Count number of resource in eventlog 27 | }} 28 | 29 | \seealso{ 30 | Other Eventlog count functions: \code{\link{n_activities}}, 31 | \code{\link{n_activity_instances}}, 32 | \code{\link{n_cases}}, \code{\link{n_resources}}, 33 | \code{\link{n_traces}} 34 | } 35 | -------------------------------------------------------------------------------- /man/n_traces.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/n_traces.R 3 | \name{n_traces} 4 | \alias{n_traces} 5 | \alias{n_traces.eventlog} 6 | \alias{n_traces.grouped_eventlog} 7 | \title{n_traces} 8 | \usage{ 9 | n_traces(eventlog) 10 | 11 | \method{n_traces}{eventlog}(eventlog) 12 | 13 | \method{n_traces}{grouped_eventlog}(eventlog) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | } 19 | \description{ 20 | Returns the number of traces in an event log 21 | } 22 | \section{Methods (by class)}{ 23 | \itemize{ 24 | \item \code{eventlog}: Count number of traces for eventlog 25 | 26 | \item \code{grouped_eventlog}: Count number of traces for grouped eventlog 27 | }} 28 | 29 | \seealso{ 30 | Other Eventlog count functions: \code{\link{n_activities}}, 31 | \code{\link{n_activity_instances}}, 32 | \code{\link{n_cases}}, \code{\link{n_events}}, 33 | \code{\link{n_resources}} 34 | } 35 | -------------------------------------------------------------------------------- /R/select.R: -------------------------------------------------------------------------------- 1 | #' @title Select event log 2 | #' @name select 3 | #' @param .data Eventlog 4 | #' @param ... Bare column names 5 | #' @param force_df If TRUE, result will no longer be a event log when not all id columns are selected. 6 | #' @importFrom dplyr select 7 | #' @export 8 | dplyr::select 9 | 10 | #' @describeIn select Select eventlog 11 | #' @export 12 | select.eventlog <- function(.data, ..., force_df = FALSE) { 13 | .order <- NULL 14 | 15 | mapping <- mapping(.data) 16 | 17 | if(force_df == FALSE) { 18 | 19 | .data %>% 20 | as.data.frame() %>% 21 | dplyr::select(..., 22 | !!case_id_(.data), 23 | !!activity_id_(.data), 24 | !!activity_instance_id_(.data), 25 | !!timestamp_(.data), 26 | !!resource_id_(.data), 27 | !!lifecycle_id_(.data), 28 | .order) %>% 29 | re_map(mapping) %>% 30 | return() 31 | } 32 | else { 33 | .data %>% 34 | as.data.frame() %>% 35 | dplyr::select(...) %>% 36 | tbl_df() %>% 37 | return() 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /man/n_resources.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/n_resources.R 3 | \name{n_resources} 4 | \alias{n_resources} 5 | \alias{n_resources.eventlog} 6 | \alias{n_resources.grouped_eventlog} 7 | \title{n_resources} 8 | \usage{ 9 | n_resources(eventlog) 10 | 11 | \method{n_resources}{eventlog}(eventlog) 12 | 13 | \method{n_resources}{grouped_eventlog}(eventlog) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | } 19 | \description{ 20 | Returns the number of resources in an event log 21 | } 22 | \section{Methods (by class)}{ 23 | \itemize{ 24 | \item \code{eventlog}: Count number of resources in eventlog 25 | 26 | \item \code{grouped_eventlog}: Count number of resources in grouped eventlog 27 | }} 28 | 29 | \seealso{ 30 | Other Eventlog count functions: \code{\link{n_activities}}, 31 | \code{\link{n_activity_instances}}, 32 | \code{\link{n_cases}}, \code{\link{n_events}}, 33 | \code{\link{n_traces}} 34 | } 35 | -------------------------------------------------------------------------------- /man/act_recode.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/act_recode.R 3 | \name{act_recode} 4 | \alias{act_recode} 5 | \alias{act_recode.eventlog} 6 | \title{Recode activity labels} 7 | \usage{ 8 | act_recode(eventlog, ...) 9 | 10 | \method{act_recode}{eventlog}(eventlog, ...) 11 | } 12 | \arguments{ 13 | \item{eventlog}{An object of class \code{eventlog}.} 14 | 15 | \item{...}{A sequence of named character vectors of length one where the names gives the new label and the value gives the old label. Labels not mentioned will be left unchanged.} 16 | } 17 | \description{ 18 | Recode one or more activity labels through specifying their old and new label 19 | } 20 | \section{Methods (by class)}{ 21 | \itemize{ 22 | \item \code{eventlog}: Recode activity labels of event log 23 | }} 24 | 25 | \seealso{ 26 | \code{\link{eventlog}}, \code{\link{activity_id}}, \code{\link{act_unite}} 27 | 28 | Other Activity processing functions: \code{\link{act_collapse}}, 29 | \code{\link{act_unite}} 30 | } 31 | -------------------------------------------------------------------------------- /man/case_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/case_id.r 3 | \name{case_id} 4 | \alias{case_id} 5 | \alias{case_id.eventlog} 6 | \alias{case_id.eventlog_mapping} 7 | \title{Case classifier} 8 | \usage{ 9 | case_id(x) 10 | 11 | \method{case_id}{eventlog}(x) 12 | 13 | \method{case_id}{eventlog_mapping}(x) 14 | } 15 | \arguments{ 16 | \item{x}{An \code{eventlog} of \code{eventlog_mapping}} 17 | } 18 | \description{ 19 | Get the case classifier of an object of class \code{eventlog} 20 | } 21 | \section{Methods (by class)}{ 22 | \itemize{ 23 | \item \code{eventlog}: Retrieve case identifier from eventlog 24 | 25 | \item \code{eventlog_mapping}: Retrieve case identifier from eventlog mapping 26 | }} 27 | 28 | \seealso{ 29 | \code{\link{eventlog}}, \code{\link{mapping}} 30 | 31 | Other Eventlog classifiers: \code{\link{activity_id}}, 32 | \code{\link{activity_instance_id}}, 33 | \code{\link{lifecycle_id}}, \code{\link{mapping}}, 34 | \code{\link{resource_id}}, \code{\link{timestamp}} 35 | } 36 | -------------------------------------------------------------------------------- /man/lifecycle_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lifecycle_id.R 3 | \name{lifecycle_id} 4 | \alias{lifecycle_id} 5 | \alias{lifecycle_id.eventlog} 6 | \alias{lifecycle_id.eventlog_mapping} 7 | \title{Life cycle classifier} 8 | \usage{ 9 | lifecycle_id(x) 10 | 11 | \method{lifecycle_id}{eventlog}(x) 12 | 13 | \method{lifecycle_id}{eventlog_mapping}(x) 14 | } 15 | \arguments{ 16 | \item{x}{An \code{eventlog} of \code{eventlog_mapping}} 17 | } 18 | \description{ 19 | Get the life_cycle_id of an object of class \code{eventlog} 20 | } 21 | \section{Methods (by class)}{ 22 | \itemize{ 23 | \item \code{eventlog}: Retrieve lifecycle identifier from eventlog 24 | 25 | \item \code{eventlog_mapping}: Retrieve lifecycle identifier from eventlog mapping 26 | }} 27 | 28 | \seealso{ 29 | Other Eventlog classifiers: \code{\link{activity_id}}, 30 | \code{\link{activity_instance_id}}, 31 | \code{\link{case_id}}, \code{\link{mapping}}, 32 | \code{\link{resource_id}}, \code{\link{timestamp}} 33 | } 34 | -------------------------------------------------------------------------------- /man/traces.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/traces.R 3 | \name{traces} 4 | \alias{traces} 5 | \alias{traces.eventlog} 6 | \alias{traces.grouped_eventlog} 7 | \title{Traces} 8 | \usage{ 9 | traces(eventlog, ...) 10 | 11 | \method{traces}{eventlog}(eventlog, ...) 12 | 13 | \method{traces}{grouped_eventlog}(eventlog, ...) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | 19 | \item{...}{Deprecated arguments} 20 | } 21 | \description{ 22 | \code{traces} computes the different activity sequences of an event log 23 | together with their absolute and relative frequencies. 24 | Activity sequences are based on the start timestamp of activities. 25 | } 26 | \section{Methods (by class)}{ 27 | \itemize{ 28 | \item \code{eventlog}: Construct traces list for eventlog 29 | 30 | \item \code{grouped_eventlog}: Construct list of traces for grouped eventlog 31 | }} 32 | 33 | \seealso{ 34 | \code{\link{cases}}, \code{\link{eventlog}} 35 | } 36 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | load <- c("edeaR", "eventdataR","processmapR","xesreadR", "processmonitR", "petrinetR") 4 | 5 | .onAttach <- function(...) { 6 | needed <- load[!is_attached(load)] 7 | 8 | if (length(needed) == 0) 9 | return() 10 | 11 | needed_installed <- ((sapply(needed, require, character.only = TRUE, warn.conflicts = FALSE))) 12 | 13 | # no_installed <- needed[!needed_installed] 14 | # 15 | # if(length(no_installed) > 0) { 16 | # packageStartupMessage(paste0("bupaR works best with the following package(s) installed: ", toString(no_installed), 17 | # ". \nDo you want to install these?\n")) 18 | # answer <- readline("Y/N: ") 19 | # 20 | # if(answer == "Y"){ 21 | # map(no_installed, ~install.packages(.x)) 22 | # } 23 | # 24 | # if(answer == "Y"){ 25 | # suppressWarnings(suppressPackageStartupMessages(sapply(no_installed, require, character.only = TRUE, warn.conflicts = FALSE))) 26 | # } 27 | # } 28 | 29 | 30 | } 31 | 32 | is_attached <- function(x) { 33 | paste0("package:", x) %in% search() 34 | } 35 | -------------------------------------------------------------------------------- /man/n_activities.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/n_activities.R 3 | \name{n_activities} 4 | \alias{n_activities} 5 | \alias{n_activities.eventlog} 6 | \alias{n_activities.grouped_eventlog} 7 | \title{n_activities} 8 | \usage{ 9 | n_activities(eventlog) 10 | 11 | \method{n_activities}{eventlog}(eventlog) 12 | 13 | \method{n_activities}{grouped_eventlog}(eventlog) 14 | } 15 | \arguments{ 16 | \item{eventlog}{The event log to be used. An object of class 17 | \code{eventlog}.} 18 | } 19 | \description{ 20 | Returns the number of activities in an event log 21 | } 22 | \section{Methods (by class)}{ 23 | \itemize{ 24 | \item \code{eventlog}: Count the number of activities in an event log 25 | 26 | \item \code{grouped_eventlog}: Count the number of activities for a grouped event log 27 | }} 28 | 29 | \seealso{ 30 | Other Eventlog count functions: \code{\link{n_activity_instances}}, 31 | \code{\link{n_cases}}, \code{\link{n_events}}, 32 | \code{\link{n_resources}}, \code{\link{n_traces}} 33 | } 34 | -------------------------------------------------------------------------------- /R/case_list.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #' Case list 4 | #' 5 | #' Construct list of cases 6 | #' 7 | #' @param eventlog Eventlog object 8 | #' 9 | #' @export 10 | #' 11 | case_list <- function(eventlog) { 12 | UseMethod("case_list") 13 | } 14 | 15 | #' @describeIn case_list Return case list 16 | #' @export 17 | 18 | 19 | case_list.eventlog <- function(eventlog){ 20 | min_order <- NULL 21 | 22 | eDT <- data.table::as.data.table(eventlog) 23 | cases <- eDT[, 24 | list("timestamp_classifier" = min(get(timestamp(eventlog))), "min_order" = min(get(".order"))), 25 | by = list("A" = get(case_id(eventlog)), "B" = get(activity_instance_id(eventlog)), "C" = get(activity_id(eventlog)))] 26 | cases <- cases[order(get("timestamp_classifier"), min_order), 27 | list(trace = paste(get("C"), collapse = ",")), 28 | by = list("CASE" = get("A"))] 29 | cases <- cases %>% mutate(trace_id = as.numeric(factor(!!as.symbol("trace")))) %>% 30 | rename(!!as.symbol(case_id(eventlog)) := "CASE") 31 | 32 | cases %>% 33 | as.data.frame %>% 34 | tbl_df 35 | } 36 | -------------------------------------------------------------------------------- /R/n_activity_instances.R: -------------------------------------------------------------------------------- 1 | #' @title n_activity_instances 2 | #' 3 | #' @description Returns the number of activity instances in an event log 4 | #' 5 | #' @param eventlog The event log to be used. An object of class 6 | #' \code{eventlog}. 7 | #' @family Eventlog count functions 8 | #' @export 9 | 10 | n_activity_instances <- function(eventlog) { 11 | UseMethod("n_activity_instances") 12 | } 13 | 14 | 15 | #' @rdname n_activity_instances 16 | #' @method n_activity_instances eventlog 17 | #' @export 18 | 19 | n_activity_instances.eventlog <- function(eventlog) { 20 | colnames(eventlog)[colnames(eventlog) == activity_instance_id(eventlog)] <- "activity_instance_classifier" 21 | return(length(unique(eventlog$activity_instance_classifier))) 22 | } 23 | 24 | #' @rdname n_activity_instances 25 | #' @method n_activity_instances grouped_eventlog 26 | #' @export 27 | n_activity_instances.grouped_eventlog <- function(eventlog) { 28 | eventlog %>% 29 | summarize(n_activity_instances = n_distinct(!!as.symbol(activity_instance_id(eventlog)))) %>% 30 | return() 31 | } 32 | 33 | -------------------------------------------------------------------------------- /man/timestamp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/timestamp.R 3 | \name{timestamp} 4 | \alias{timestamp} 5 | \alias{timestamp.eventlog} 6 | \alias{timestamp.eventlog_mapping} 7 | \title{Timestamp classifier} 8 | \usage{ 9 | timestamp(x) 10 | 11 | \method{timestamp}{eventlog}(x) 12 | 13 | \method{timestamp}{eventlog_mapping}(x) 14 | } 15 | \arguments{ 16 | \item{x}{An \code{eventlog} of \code{eventlog_mapping}} 17 | } 18 | \description{ 19 | Get the timestamp classifier of an object of class \code{eventlog} 20 | } 21 | \section{Methods (by class)}{ 22 | \itemize{ 23 | \item \code{eventlog}: Retrieve timestamp identifier from eventlog 24 | 25 | \item \code{eventlog_mapping}: Retrieve timestamp identifier from eventlog mapping 26 | }} 27 | 28 | \seealso{ 29 | \code{\link{eventlog}}, \code{\link{mapping}} 30 | 31 | Other Eventlog classifiers: \code{\link{activity_id}}, 32 | \code{\link{activity_instance_id}}, 33 | \code{\link{case_id}}, \code{\link{lifecycle_id}}, 34 | \code{\link{mapping}}, \code{\link{resource_id}} 35 | } 36 | -------------------------------------------------------------------------------- /man/activity_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/activity_id.R 3 | \name{activity_id} 4 | \alias{activity_id} 5 | \alias{activity_id.eventlog} 6 | \alias{activity_id.eventlog_mapping} 7 | \title{Activity classifier} 8 | \usage{ 9 | activity_id(x) 10 | 11 | \method{activity_id}{eventlog}(x) 12 | 13 | \method{activity_id}{eventlog_mapping}(x) 14 | } 15 | \arguments{ 16 | \item{x}{An \code{eventlog} of \code{eventlog_mapping}} 17 | } 18 | \description{ 19 | Get the activity classifier of an object of class \code{eventlog}. 20 | } 21 | \section{Methods (by class)}{ 22 | \itemize{ 23 | \item \code{eventlog}: Retrieve activity identifier from eventlog 24 | 25 | \item \code{eventlog_mapping}: Retrieve activity identifier from eventlog mapping 26 | }} 27 | 28 | \seealso{ 29 | \code{\link{eventlog}}, \code{\link{mapping}} 30 | 31 | Other Eventlog classifiers: \code{\link{activity_instance_id}}, 32 | \code{\link{case_id}}, \code{\link{lifecycle_id}}, 33 | \code{\link{mapping}}, \code{\link{resource_id}}, 34 | \code{\link{timestamp}} 35 | } 36 | -------------------------------------------------------------------------------- /man/resource_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/resource_id.R 3 | \name{resource_id} 4 | \alias{resource_id} 5 | \alias{resource_id.eventlog} 6 | \alias{resource_id.eventlog_mapping} 7 | \title{Resource classifier} 8 | \usage{ 9 | resource_id(x) 10 | 11 | \method{resource_id}{eventlog}(x) 12 | 13 | \method{resource_id}{eventlog_mapping}(x) 14 | } 15 | \arguments{ 16 | \item{x}{An \code{eventlog} of \code{eventlog_mapping}} 17 | } 18 | \description{ 19 | Get the resource classifier of an object of class \code{eventlog}. 20 | } 21 | \section{Methods (by class)}{ 22 | \itemize{ 23 | \item \code{eventlog}: Retrieve resource identifier from eventlog 24 | 25 | \item \code{eventlog_mapping}: Retrieve resource identifier from eventlog mapping 26 | }} 27 | 28 | \seealso{ 29 | \code{\link{eventlog}}, \code{\link{mapping}} 30 | 31 | Other Eventlog classifiers: \code{\link{activity_id}}, 32 | \code{\link{activity_instance_id}}, 33 | \code{\link{case_id}}, \code{\link{lifecycle_id}}, 34 | \code{\link{mapping}}, \code{\link{timestamp}} 35 | } 36 | -------------------------------------------------------------------------------- /R/unite.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Unite multiple columns into one. 2 | 3 | #' @param .data Eventlog 4 | #' @param col The name of the new column (character value) 5 | #' @param ... Columns to be united. 6 | #' @param sep Seperator 7 | #' @param remove Remove original columns 8 | #' @name unite 9 | #' @importFrom tidyr unite 10 | #' @export 11 | tidyr::unite 12 | 13 | #' @describeIn unite Unite columns in eventlog 14 | #' @export 15 | 16 | unite.eventlog <- function(data, col, ..., sep = "_", remove = T) { 17 | 18 | mapping <- mapping(data) 19 | data %>% 20 | as.data.frame() %>% 21 | unite(col = !!col, ..., sep = sep, remove = remove) %>% 22 | re_map(mapping) 23 | } 24 | 25 | #' @describeIn unite Unite columns in grouped eventlog 26 | #' @export 27 | 28 | unite.grouped_eventlog <- function(data, col, ..., sep = "_", remove = T) { 29 | 30 | mapping <- mapping(data) 31 | groups <- groups(data) 32 | 33 | data %>% 34 | as.data.frame() %>% 35 | unite(col = !!col, ..., sep = sep, remove = remove) %>% 36 | re_map(mapping) %>% 37 | group_by_at(vars(one_of(paste(groups)))) 38 | 39 | } 40 | -------------------------------------------------------------------------------- /R/first_n.R: -------------------------------------------------------------------------------- 1 | 2 | #' Select first n activity instances 3 | #' 4 | #' @param eventlog Eventlog object 5 | #' @param n Integer value 6 | #' 7 | #' @export 8 | first_n <- function(eventlog, n) { 9 | UseMethod("first_n") 10 | } 11 | 12 | #' @describeIn first_n Select first n activity instances in event log 13 | #' @export 14 | first_n.eventlog <- function(eventlog, n) { 15 | eventlog %>% 16 | first_n_raw( timestamp(eventlog), activity_instance_id(eventlog), n) %>% 17 | re_map(mapping(eventlog)) 18 | } 19 | 20 | first_n_raw <- function(.data, .timestamp, .activity_instance_id, n) { 21 | .order <- NULL 22 | .data %>% 23 | arrange(!!sym(.timestamp), .order) %>% 24 | slice_activities_raw(.activity_instance_id, 1:n) 25 | } 26 | 27 | #' @describeIn first_n Select first n activity instances in grouped event log 28 | #' @export 29 | #' 30 | first_n.grouped_eventlog <- function(eventlog, n) { 31 | .order <- NULL 32 | 33 | groups <- groups(eventlog) 34 | mapping <- mapping(eventlog) 35 | eventlog %>% 36 | arrange(!!timestamp_(eventlog), .order) %>% 37 | slice_activities(1:n) 38 | 39 | } 40 | -------------------------------------------------------------------------------- /man/unite.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/unite.eventlog.R 3 | \docType{import} 4 | \name{unite} 5 | \alias{unite} 6 | \alias{unite.eventlog} 7 | \alias{unite.grouped_eventlog} 8 | \title{Unite multiple columns into one.} 9 | \usage{ 10 | \method{unite}{eventlog}(data, col, ..., sep = "_", remove = T) 11 | 12 | \method{unite}{grouped_eventlog}(data, col, ..., sep = "_", remove = T) 13 | } 14 | \arguments{ 15 | \item{col}{The name of the new column (character value)} 16 | 17 | \item{...}{Columns to be united.} 18 | 19 | \item{sep}{Seperator} 20 | 21 | \item{remove}{Remove original columns} 22 | 23 | \item{.data}{Eventlog} 24 | } 25 | \section{Methods (by class)}{ 26 | \itemize{ 27 | \item \code{eventlog}: Unite columns in eventlog 28 | 29 | \item \code{grouped_eventlog}: Unite columns in grouped eventlog 30 | }} 31 | 32 | \keyword{internal} 33 | \description{ 34 | These objects are imported from other packages. Follow the links 35 | below to see their documentation. 36 | 37 | \describe{ 38 | \item{tidyr}{\code{\link[tidyr]{unite}}} 39 | }} 40 | 41 | -------------------------------------------------------------------------------- /man/activity_instance_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/activity_instance_id.R 3 | \name{activity_instance_id} 4 | \alias{activity_instance_id} 5 | \alias{activity_instance_id.eventlog} 6 | \alias{activity_instance_id.eventlog_mapping} 7 | \title{Activity instance classifier} 8 | \usage{ 9 | activity_instance_id(x) 10 | 11 | \method{activity_instance_id}{eventlog}(x) 12 | 13 | \method{activity_instance_id}{eventlog_mapping}(x) 14 | } 15 | \arguments{ 16 | \item{x}{An \code{eventlog} of \code{eventlog_mapping}} 17 | } 18 | \description{ 19 | Get the activity instance classifier of an object of class \code{eventlog}. 20 | } 21 | \section{Methods (by class)}{ 22 | \itemize{ 23 | \item \code{eventlog}: Retrieve activity instance identifier from eventlog 24 | 25 | \item \code{eventlog_mapping}: Retrieve activity instance identifier from eventlog mapping 26 | }} 27 | 28 | \seealso{ 29 | Other Eventlog classifiers: \code{\link{activity_id}}, 30 | \code{\link{case_id}}, \code{\link{lifecycle_id}}, 31 | \code{\link{mapping}}, \code{\link{resource_id}}, 32 | \code{\link{timestamp}} 33 | } 34 | -------------------------------------------------------------------------------- /man/sample_n.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sample_n.eventlog.R 3 | \docType{import} 4 | \name{sample_n} 5 | \alias{sample_n} 6 | \alias{sample_n.eventlog} 7 | \alias{sample_n.grouped_eventlog} 8 | \title{Sample function for eventlog} 9 | \usage{ 10 | \method{sample_n}{eventlog}(tbl, size, replace = FALSE, weight, .env) 11 | 12 | \method{sample_n}{grouped_eventlog}(tbl, size, replace = FALSE, weight, .env) 13 | } 14 | \arguments{ 15 | \item{tbl}{Eventlog} 16 | 17 | \item{size}{Number of cases to sample} 18 | 19 | \item{replace}{Sample with replacement or not} 20 | 21 | \item{weight}{N/A} 22 | 23 | \item{.env}{N/A} 24 | } 25 | \section{Methods (by class)}{ 26 | \itemize{ 27 | \item \code{eventlog}: Sample n cases of eventlog 28 | 29 | \item \code{grouped_eventlog}: Stratified sampling of a grouped eventlog: sample n cases within each group 30 | }} 31 | 32 | \keyword{internal} 33 | \description{ 34 | These objects are imported from other packages. Follow the links 35 | below to see their documentation. 36 | 37 | \describe{ 38 | \item{dplyr}{\code{\link[dplyr]{sample_n}}} 39 | }} 40 | 41 | -------------------------------------------------------------------------------- /R/bupar.R: -------------------------------------------------------------------------------- 1 | #' @title bupaR - Business Process Analysis in R 2 | #' @docType package 3 | #' @name bupaR 4 | #' @description Functionalities for process analysis in R. This packages implements an S3-class for event log objects, and related handler functions. Imports related packages for subsetting event data, computation of descriptive statistics, handling of Petri Net objects and visualization of process maps. 5 | #' 6 | #' @importFrom magrittr %>% 7 | #' @importFrom data.table data.table 8 | #' @importFrom data.table := 9 | #' @import dplyr 10 | #' @import shiny 11 | #' @import miniUI 12 | #' @import eventdataR 13 | #' @importFrom tidyr unite 14 | #' @importFrom glue glue 15 | #' @importFrom forcats fct_collapse 16 | #' @importFrom purrr map 17 | #' @importFrom purrr pmap 18 | #' @importFrom tidyr nest 19 | #' @importFrom tidyr unnest 20 | #' @importFrom stats median 21 | #' @importFrom stats na.omit 22 | #' @importFrom stats quantile 23 | #' @importFrom stats sd 24 | #' @importFrom utils head 25 | #' @importFrom utils setTxtProgressBar 26 | #' @importFrom utils txtProgressBar 27 | #' @importFrom utils data 28 | globalVariables(c(".")) 29 | "_PACKAGE" 30 | 31 | -------------------------------------------------------------------------------- /R/durations.R: -------------------------------------------------------------------------------- 1 | #' @title Durations 2 | #' 3 | #' @description Computes the throughput times of each case. 4 | #' Throughput time is defined as the interval between the start of the first event and the completion of the last event. 5 | #' 6 | #' @param eventlog The event log to be used. An object of class 7 | #' \code{eventlog}. 8 | #' @param units The time unit in which the throughput times should be reported. 9 | #' @export durations 10 | durations <- function(eventlog, units) { 11 | UseMethod("durations") 12 | } 13 | #' @describeIn durations Compute durations from eventlog 14 | #' @export 15 | durations.eventlog <- function(eventlog, 16 | units = "days") { 17 | 18 | e <- eventlog 19 | 20 | durations <- e %>% group_by(!!as.symbol(case_id(eventlog))) %>% summarize(s = min(!!as.symbol(timestamp(eventlog))), 21 | e = max(!!as.symbol(timestamp(eventlog)))) 22 | 23 | durations$duration <- durations$e - durations$s 24 | durations$duration <- as.double(durations$duration, units = units) 25 | 26 | durations <- durations %>% select(one_of(c(case_id(eventlog), "duration"))) %>% arrange(desc(!!as.symbol("duration"))) 27 | 28 | colnames(durations)[colnames(durations)=="duration"] <- paste("duration_in_", units, sep ="") 29 | 30 | durations <- tbl_df(durations) 31 | 32 | return(durations) 33 | 34 | } 35 | -------------------------------------------------------------------------------- /R/activities_to_eventlog.R: -------------------------------------------------------------------------------- 1 | #' Create event log from list of activity instances 2 | #' 3 | #' @param activity_log A data.frame where each row is an activity instances 4 | #' @param case_id Column name of the case identifier 5 | #' @param activity_id Column name of the activity identifier 6 | #' @param resource_id Column name of the resource identifier 7 | #' @param timestamps A vector of column names containing different timestamp. To column names will be transformed to lifecycle identifiers 8 | #' 9 | #' @export 10 | activities_to_eventlog <- function(activity_log, 11 | case_id, 12 | activity_id, 13 | resource_id, 14 | timestamps) { 15 | 16 | stopifnot(is.data.frame(activity_log)) 17 | stopifnot(is.character(case_id)) 18 | stopifnot(is.character(activity_id)) 19 | stopifnot(is.character(resource_id)) 20 | stopifnot(is.character(timestamps)) 21 | stopifnot(length(timestamps) > 1) 22 | 23 | activity_log %>% 24 | ungroup() %>% 25 | mutate(activity_instance_id = 1:n()) %>% 26 | tidyr::gather(lifecycle_id, timestamp, one_of(timestamps)) %>% 27 | eventlog(case_id = case_id, 28 | activity_id = activity_id, 29 | activity_instance_id = "activity_instance_id", 30 | lifecycle_id = "lifecycle_id", 31 | timestamp = "timestamp", 32 | resource_id = resource_id) 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /man/add_end_activity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/add_start_end_activity.R 3 | \name{add_end_activity} 4 | \alias{add_end_activity} 5 | \alias{add_start_activity} 6 | \alias{add_end_activity.eventlog} 7 | \alias{add_end_activity.grouped_eventlog} 8 | \alias{add_start_activity.eventlog} 9 | \alias{add_start_activity.grouped_eventlog} 10 | \title{Add artificial start/end activities to} 11 | \usage{ 12 | add_end_activity(eventlog, label) 13 | 14 | add_start_activity(eventlog, label) 15 | 16 | \method{add_end_activity}{eventlog}(eventlog, label = "End") 17 | 18 | \method{add_end_activity}{grouped_eventlog}(eventlog, label = "End") 19 | 20 | \method{add_start_activity}{eventlog}(eventlog, label = "Start") 21 | 22 | \method{add_start_activity}{grouped_eventlog}(eventlog, label = "Start") 23 | } 24 | \arguments{ 25 | \item{eventlog}{Event log} 26 | 27 | \item{label}{Start/end activity label} 28 | } 29 | \description{ 30 | Add artificial start/end activities to 31 | } 32 | \section{Methods (by class)}{ 33 | \itemize{ 34 | \item \code{eventlog}: Add end activity to event log 35 | 36 | \item \code{grouped_eventlog}: Add end activity to grouped event log 37 | 38 | \item \code{eventlog}: Add start activity to event log 39 | 40 | \item \code{grouped_eventlog}: Add start activity to grouped event log 41 | }} 42 | 43 | -------------------------------------------------------------------------------- /R/last_n.R: -------------------------------------------------------------------------------- 1 | 2 | #' Select last n activity instances 3 | #' 4 | #' @param eventlog Eventlog object 5 | #' @param n Integer value 6 | #' 7 | #' @export 8 | last_n <- function(eventlog, n) { 9 | UseMethod("last_n") 10 | } 11 | 12 | #' @describeIn last_n Select first n activity instances in event log 13 | #' @export 14 | last_n.eventlog <- function(eventlog, n) { 15 | eventlog %>% 16 | last_n_raw( timestamp(eventlog), activity_instance_id(eventlog), n) %>% 17 | re_map(mapping(eventlog)) 18 | } 19 | 20 | last_n_raw <- function(.data, .timestamp, .activity_instance_id, n) { 21 | 22 | .order <- NULL 23 | .data %>% 24 | pull(!!sym(.activity_instance_id)) %>% 25 | unique %>% 26 | length -> n_instances 27 | 28 | .data %>% 29 | arrange(!!sym(.timestamp), .order) %>% 30 | slice_activities_raw(.activity_instance_id, (n_instances + 1 - n):n_instances) 31 | } 32 | 33 | #' @describeIn last_n Select first n activity instances in grouped event log 34 | #' @export 35 | #' 36 | last_n.grouped_eventlog <- function(eventlog, n) { 37 | groups <- groups(eventlog) 38 | mapping <- mapping(eventlog) 39 | 40 | aid <- activity_instance_id(eventlog) 41 | ts <- timestamp(eventlog) 42 | 43 | eventlog %>% 44 | nest() %>% 45 | mutate(data = map(data, last_n_raw, ts, aid, n)) %>% 46 | unnest() %>% 47 | re_map(mapping) %>% 48 | group_by_at(vars(one_of(paste(groups)))) 49 | 50 | } 51 | -------------------------------------------------------------------------------- /R/summary.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Generic summary function for eventlog class 2 | #' @description Generic summary function for eventlog class 3 | #' @param object Eventlog object 4 | #' @param ... Additional Arguments 5 | #' @rdname summary 6 | #' @method summary eventlog 7 | #' @export 8 | 9 | summary.eventlog <- function(object, ...){ 10 | 11 | eventlog <- object 12 | 13 | ca <- case_list(eventlog) 14 | 15 | number_of_events <- nrow(eventlog) 16 | number_of_cases <- nrow(ca) 17 | number_of_traces <- length(unique(ca$trace_id)) 18 | number_of_activities <- nrow(activities(eventlog)) 19 | 20 | 21 | first_event <- as.character(min(pull(eventlog, !!as.symbol(timestamp(eventlog))))) 22 | last_event <- as.character(max(pull(eventlog, !!as.symbol(timestamp(eventlog))))) 23 | 24 | events_per_case <- number_of_events/number_of_cases 25 | 26 | cat("Number of events: ") 27 | cat(number_of_events) 28 | cat("\nNumber of cases: ") 29 | cat(number_of_cases) 30 | cat("\nNumber of traces: ") 31 | cat(number_of_traces) 32 | cat("\nNumber of distinct activities: ") 33 | cat(number_of_activities) 34 | cat("\nAverage trace length: ") 35 | cat(events_per_case) 36 | cat("\n\nStart eventlog: ") 37 | cat(first_event) 38 | cat("\nEnd eventlog: ") 39 | cat(last_event) 40 | cat("\n\n") 41 | NextMethod(object) 42 | 43 | } 44 | 45 | #' @describeIn summary Summary of grouped event log 46 | #' @export 47 | 48 | summary.grouped_eventlog <- function(object, ...) { 49 | object <- eventlog(object) 50 | NextMethod(object) 51 | } 52 | -------------------------------------------------------------------------------- /R/trace_list.R: -------------------------------------------------------------------------------- 1 | #' Trace list 2 | #' 3 | #' Construct trace list 4 | #' 5 | #' @param eventlog Eventlog object 6 | #' 7 | #' @export 8 | #' 9 | 10 | trace_list <- function(eventlog){ 11 | UseMethod("trace_list") 12 | } 13 | 14 | #' @describeIn trace_list Construct trace list for event log 15 | #' @export 16 | 17 | trace_list.eventlog <- function(eventlog){ 18 | min_order <- NULL 19 | 20 | 21 | if(nrow(eventlog) == 0) { 22 | return(data.frame(trace = numeric(), absolute_frequency = numeric(), relative_frequency = numeric())) 23 | } 24 | 25 | 26 | eDT <- data.table::data.table(eventlog) 27 | 28 | cases <- eDT[, 29 | list("timestamp_classifier" = min(get(timestamp(eventlog))), "min_order" = min(get(".order"))), 30 | by = list("A" = get(case_id(eventlog)), "B" = get(activity_instance_id(eventlog)), "C" = get(activity_id(eventlog)))] 31 | cases <- cases[order(get("timestamp_classifier"), min_order), 32 | list(trace = paste(get("C"), collapse = ",")), 33 | by = list("CASE" = get("A"))] 34 | cases <- cases %>% mutate(trace_id = as.numeric(factor(!!as.symbol("trace")))) %>% 35 | rename(!!as.symbol(case_id(eventlog)) := "CASE") 36 | 37 | .N <- NULL 38 | absolute_frequency <- NULL 39 | relative_frequency <- NULL 40 | 41 | casesDT <- data.table(cases) 42 | 43 | traces <- casesDT[, .(absolute_frequency = .N), by = .(trace)] 44 | 45 | traces <- traces[order(absolute_frequency, decreasing = T),relative_frequency:=absolute_frequency/sum(absolute_frequency)] 46 | traces %>% 47 | tbl_df 48 | 49 | } 50 | -------------------------------------------------------------------------------- /R/print.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Generic print function for eventlog 2 | #' @description Generic print function for eventlog 3 | #' @param x Eventlog object 4 | #' @param ... Additional Arguments 5 | #' @export 6 | 7 | 8 | print.eventlog <- function(x, ...) { 9 | nev <- n_events() 10 | cat("Log of", nev, ngettext(nev, "event" "events"), "consisting of:\n") 11 | if(nev < 250000) { 12 | ntr <- nrow(trace_list(x)) 13 | cat(ntr, ngettext(ntr, "trace" "traces"), "\n") 14 | } 15 | ncs <- n_cases(x) 16 | cat(ncs, ngettext(ncs, "case" "cases"), "\n") 17 | nai <- n_activity_instances(x) 18 | nac <- n_activities(x) 19 | cat( 20 | nai, ngettext(nai, "instance" "instances"), "of", 21 | nac, ngettext(nac, "activity" "activities"), "\n" 22 | ) 23 | nrs <- n_resources(x) 24 | cat(nrs, ngettext(nrs, "resource" "resources"), "\n") 25 | timestamps <- x[[timestamp(x)]] 26 | cat( 27 | "Events occurred from", format(min(timestamps)), 28 | "until", format(max(timestamps)), "\n" 29 | ) 30 | cat("Variables were mapped as follows:\n") 31 | print(mapping(x)) 32 | cat("\n") 33 | NextMethod(x) 34 | } 35 | 36 | #' @export 37 | print.grouped_eventlog <- function(x, ...) { 38 | groups <- groups(x) 39 | x <- eventlog(x) 40 | cat(glue("# Groups: [{paste(groups, collapse = \", \")}]")) 41 | cat("\nGrouped ") 42 | NextMethod(x) 43 | } 44 | -------------------------------------------------------------------------------- /R/sample_n.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Sample function for eventlog 2 | #' @param tbl Eventlog 3 | #' @param size Number of cases to sample 4 | #' @param replace Sample with replacement or not 5 | #' @param weight N/A 6 | #' @param .env N/A 7 | #' @name sample_n 8 | #' @importFrom dplyr sample_n 9 | #' @export 10 | dplyr::sample_n 11 | 12 | #' @describeIn sample_n Sample n cases of eventlog 13 | #' @export 14 | 15 | sample_n.eventlog <- function(tbl,size, replace = FALSE, weight, .env) { 16 | 17 | 18 | n_cases <- n_cases(tbl) 19 | 20 | if(!replace & size > n_cases) { 21 | stop(paste(c("Size parameter (", size, ") is larger than number of cases (", n_cases ,"). Do you want to use replace = T?"), collapse = "")) 22 | } 23 | 24 | case_ids <- tbl %>% 25 | rename_("case_classifier" = case_id(tbl)) %>% 26 | .$case_classifier %>% 27 | unique 28 | 29 | selection <- sample(case_ids, size = size, replace = replace) 30 | 31 | tbl %>% 32 | filter((!!as.symbol(case_id(tbl))) %in% selection) 33 | } 34 | 35 | 36 | #' @describeIn sample_n Stratified sampling of a grouped eventlog: sample n cases within each group 37 | #' @method sample_n grouped_eventlog 38 | #' @export 39 | 40 | sample_n.grouped_eventlog <- function(tbl, size, replace = FALSE, weight, .env) { 41 | 42 | mapping <- mapping(tbl) 43 | 44 | tbl %>% 45 | nest() %>% 46 | mutate(data = map(data, re_map, mapping)) %>% 47 | mutate(data = map(data, sample_n, size = size, replace = replace)) %>% 48 | unnest() %>% 49 | re_map(mapping) %>% 50 | return() 51 | 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /man/simple_eventlog.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simple_eventlog.R 3 | \name{simple_eventlog} 4 | \alias{simple_eventlog} 5 | \alias{isimple_eventlog} 6 | \title{Simple Eventlog} 7 | \usage{ 8 | simple_eventlog(eventlog, case_id = NULL, activity_id = NULL, 9 | timestamp = NULL, order = "auto") 10 | 11 | isimple_eventlog(eventlog) 12 | } 13 | \arguments{ 14 | \item{eventlog}{The data object to be used as event log. This can be a 15 | \code{data.frame} or \code{tbl_df}.} 16 | 17 | \item{case_id}{The case classifier of the event log.} 18 | 19 | \item{activity_id}{The activity classifier of the event log.} 20 | 21 | \item{timestamp}{The timestamp of the event log.} 22 | 23 | \item{order}{Configure how to handle sort events with equal timestamps: 24 | auto will use the order in the original data, 25 | alphabetical will sort the activity labels by alpabath, 26 | providing a column name will use this column for ordering (can be numeric of character). 27 | The latter will never overrule timestamp orderings.} 28 | } 29 | \description{ 30 | A function to instantiate an object of class \code{eventlog} by specifying a 31 | \code{data.frame} or \code{tbl_df} and the minimally required case identifier, activity identifier and timestamp 32 | } 33 | \examples{ 34 | \dontrun{ 35 | data <- data.frame(case = rep("A",5), 36 | activity_id = c("A","B","C","D","E"), 37 | timestamp = date_decimal(1:5)) 38 | simple_eventlog(data,case_id = "case", 39 | activity_id = "activity_id", 40 | timestamp = "timestamp") 41 | } 42 | } 43 | \seealso{ 44 | \code{\link{eventlog}},\code{\link{case_id}}, \code{\link{activity_id}}, 45 | \code{\link{activity_instance_id}},\code{\link{lifecycle_id}}, 46 | \code{\link{timestamp}} 47 | } 48 | -------------------------------------------------------------------------------- /R/activities.R: -------------------------------------------------------------------------------- 1 | #' @title Activities 2 | #' 3 | #' @description Returns a \code{tbl_df} containing a list of all activity types in the event log, with their absolute and relative frequency 4 | #' 5 | #' @param eventlog The event log to be used. An object of class 6 | #' \code{eventlog}. 7 | #' 8 | #' @seealso \code{\link{activity_id}},\code{\link{activity_instance_id}}, \code{\link{eventlog}} 9 | #' 10 | #' @export activities 11 | #' 12 | activities <- function(eventlog) { 13 | UseMethod("activities") 14 | } 15 | 16 | #' @describeIn activities Generate activity list for eventlog 17 | #' @export 18 | 19 | activities.eventlog <- function(eventlog) { 20 | 21 | eventlog %>% 22 | group_by(!!as.symbol(activity_id(eventlog))) %>% 23 | summarize("absolute_frequency" = n_distinct(!!as.symbol(activity_instance_id(eventlog)))) %>% 24 | arrange(-!!as.symbol("absolute_frequency")) %>% 25 | mutate("relative_frequency" := (!!as.symbol("absolute_frequency"))/sum( (!!as.symbol("absolute_frequency")))) 26 | } 27 | 28 | #' @describeIn activities Generate activity list for grouped eventlog 29 | #' @export 30 | 31 | activities.grouped_eventlog <- function(eventlog) { 32 | mapping <- mapping(eventlog) 33 | 34 | eventlog %>% 35 | nest() %>% 36 | mutate(data = map(data, re_map, mapping)) %>% 37 | mutate(data = map(data, activities)) %>% 38 | unnest() 39 | } 40 | 41 | #' @title Get vector of activity labels 42 | #' @description Retrieve a vector containing all unique activity labels 43 | #' @param eventlog Eventlog 44 | #' @export 45 | activity_labels <- function(eventlog) { 46 | UseMethod("activity_labels") 47 | } 48 | 49 | #' @describeIn activity_labels Retrieve activity labels from eventlog 50 | #' @export 51 | activity_labels.eventlog <- function(eventlog) { 52 | eventlog %>% 53 | ungroup() %>% 54 | pull(!!activity_id_(eventlog)) %>% 55 | unique() 56 | } 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /R/resources.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #' @title Resources 4 | #' 5 | #' @description Returns a \code{tbl_df} containing a list of all resources in the event log, with there absolute and relative frequency 6 | #' 7 | #' @param eventlog The event log to be used. An object of class 8 | #' \code{eventlog}. 9 | #' 10 | #' 11 | #' @seealso \code{\link{resource_id}}, \code{\link{eventlog}} 12 | #' 13 | #' 14 | #' @export resources 15 | 16 | resources <- function(eventlog) { 17 | UseMethod("resources") 18 | } 19 | 20 | #' @describeIn resources Generate resource list for eventlog 21 | #' @export 22 | 23 | resources.eventlog <- function(eventlog) { 24 | 25 | absolute_frequency <- NULL 26 | relative_frequency <- NULL 27 | 28 | output <- eventlog %>% 29 | group_by(!!as.symbol(resource_id(eventlog))) %>% 30 | summarize("absolute_frequency" = n_distinct(!!as.symbol(activity_instance_id(eventlog)))) %>% 31 | arrange(-absolute_frequency) %>% 32 | mutate(relative_frequency = absolute_frequency/sum(absolute_frequency)) %>% 33 | arrange(-relative_frequency) 34 | 35 | return(output) 36 | } 37 | #' @describeIn resources Generate resource list for grouped eventlog 38 | #' @export 39 | resources.grouped_eventlog <- function(eventlog) { 40 | mapping <- mapping(eventlog) 41 | 42 | eventlog %>% 43 | nest() %>% 44 | mutate(data = map(data, re_map, mapping)) %>% 45 | mutate(data = map(data, resources)) %>% 46 | unnest() %>% 47 | return() 48 | } 49 | 50 | #' @title Get vector of resource labels 51 | #' @description Retrieve a vector containing all unique resource labels 52 | #' @param eventlog Eventlog 53 | #' @export 54 | resource_labels <- function(eventlog) { 55 | UseMethod("resource_labels") 56 | } 57 | 58 | #' @describeIn resource_labels Retrieve resource labels from eventlog 59 | #' @export 60 | resource_labels.eventlog <- function(eventlog) { 61 | eventlog %>% 62 | ungroup() %>% 63 | pull(!!resource_id(eventlog)) %>% 64 | unique() 65 | } 66 | 67 | 68 | -------------------------------------------------------------------------------- /man/act_collapse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/act_collapse.R 3 | \name{act_collapse} 4 | \alias{act_collapse} 5 | \alias{act_collapse.eventlog} 6 | \title{Collapse activity labels of a sub process into a single activity} 7 | \usage{ 8 | act_collapse(eventlog, ..., method) 9 | 10 | \method{act_collapse}{eventlog}(eventlog, ..., method = c("entry_points", 11 | "consecutive")) 12 | } 13 | \arguments{ 14 | \item{eventlog}{An \code{eventlog} object} 15 | 16 | \item{...}{A series of named character vectors. The activity labels in each vector will be collapsed into one activity with the name of the vector.} 17 | 18 | \item{method}{Defines how activities are collapsed: "entry_points" heuristically learns which of the specified activities occur at the start and end of the subprocess and collapses accordingly. "consecutive" collapses consecutive sequences of the activities.} 19 | } 20 | \description{ 21 | Collapse activity labels of a sub process into a single activity 22 | } 23 | \details{ 24 | There are different strategies to collapse activity labels (argument ´method´). The "entry_points" method aims to learn the start and end activities of the sub process, by looking at the first and last activity in each case over the whole log. Subsequently, it will create a new instance of the sub process each time there is an end activity followed by a start activity. This strategy will not take into account other activities happening in the mean time. The "consecutive" method will create an instance each time a new sequence of sub activities is started. This strategy will thus only take into account interruptions of the other activity labels. 25 | } 26 | \section{Methods (by class)}{ 27 | \itemize{ 28 | \item \code{eventlog}: Collapse activity labels of a subprocess into a single activity 29 | }} 30 | 31 | \seealso{ 32 | Other Activity processing functions: \code{\link{act_recode}}, 33 | \code{\link{act_unite}} 34 | } 35 | -------------------------------------------------------------------------------- /R/cases.r: -------------------------------------------------------------------------------- 1 | #' @title Cases 2 | #' 3 | #' @description Provides a fine-grained summary of an event log with characteristics for each case: the number of events, 4 | #' the number of activity types, the timespan, the trace, the duration and the first and last event type. 5 | #' 6 | #' 7 | #' @param eventlog An eventlog object. 8 | #' \code{eventlog}. 9 | #' 10 | #' 11 | #' @export 12 | cases <- function(eventlog) { 13 | UseMethod("cases") 14 | } 15 | 16 | #' @describeIn cases Constructy list of cases in an eventlog 17 | #' @export 18 | cases.eventlog <- function(eventlog){ 19 | 20 | traces_per_case <- case_list(eventlog) 21 | durations <- durations(eventlog) 22 | 23 | 24 | summary <- eventlog %>% 25 | group_by(!!as.symbol(case_id(eventlog))) %>% 26 | summarize(trace_length = n_distinct(!!as.symbol(activity_instance_id(eventlog))), 27 | number_of_activities = n_distinct(!!as.symbol(activity_id(eventlog))), 28 | start_timestamp = min(!!as.symbol(timestamp(eventlog))), 29 | complete_timestamp = max(!!as.symbol(timestamp(eventlog)))) 30 | 31 | summary <- inner_join(summary, traces_per_case, by = case_id(eventlog)) 32 | summary <- inner_join(summary, durations, by = case_id(eventlog)) 33 | 34 | summary$first_activity <- NA_character_ 35 | summary$last_activity <- NA_character_ 36 | 37 | for(i in 1:nrow(summary)){ 38 | summary$first_activity[i] <- strsplit(summary$trace[i], split = ",")[[1]][1] 39 | summary$last_activity[i] <- strsplit(summary$trace[i], split = ",")[[1]][length(strsplit(summary$trace[i], split =",")[[1]])] 40 | } 41 | summary$first_activity <- as.factor(summary$first_activity) 42 | summary$last_activity <- as.factor(summary$last_activity) 43 | 44 | 45 | summary <- tbl_df(summary) 46 | return(summary) 47 | 48 | 49 | } 50 | 51 | #' @title Get vector of case labels 52 | #' @description Retrieve a vector containing all unique case labels 53 | #' @param eventlog Eventlog 54 | #' @export 55 | case_labels <- function(eventlog) { 56 | UseMethod("case_labels") 57 | } 58 | 59 | #' @describeIn case_labels Retrieve case labels from eventlog 60 | #' @export 61 | case_labels.eventlog <- function(eventlog) { 62 | eventlog %>% 63 | ungroup() %>% 64 | pull(!!case_id_(eventlog)) %>% 65 | unique() 66 | } 67 | 68 | -------------------------------------------------------------------------------- /docs/docsearch.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // register a handler to move the focus to the search bar 4 | // upon pressing shift + "/" (i.e. "?") 5 | $(document).on('keydown', function(e) { 6 | if (e.shiftKey && e.keyCode == 191) { 7 | e.preventDefault(); 8 | $("#search-input").focus(); 9 | } 10 | }); 11 | 12 | $(document).ready(function() { 13 | // do keyword highlighting 14 | /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ 15 | var mark = function() { 16 | 17 | var referrer = document.URL ; 18 | var paramKey = "q" ; 19 | 20 | if (referrer.indexOf("?") !== -1) { 21 | var qs = referrer.substr(referrer.indexOf('?') + 1); 22 | var qs_noanchor = qs.split('#')[0]; 23 | var qsa = qs_noanchor.split('&'); 24 | var keyword = ""; 25 | 26 | for (var i = 0; i < qsa.length; i++) { 27 | var currentParam = qsa[i].split('='); 28 | 29 | if (currentParam.length !== 2) { 30 | continue; 31 | } 32 | 33 | if (currentParam[0] == paramKey) { 34 | keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); 35 | } 36 | } 37 | 38 | if (keyword !== "") { 39 | $(".contents").unmark({ 40 | done: function() { 41 | $(".contents").mark(keyword); 42 | } 43 | }); 44 | } 45 | } 46 | }; 47 | 48 | mark(); 49 | }); 50 | }); 51 | 52 | /* Search term highlighting ------------------------------*/ 53 | 54 | function matchedWords(hit) { 55 | var words = []; 56 | 57 | var hierarchy = hit._highlightResult.hierarchy; 58 | // loop to fetch from lvl0, lvl1, etc. 59 | for (var idx in hierarchy) { 60 | words = words.concat(hierarchy[idx].matchedWords); 61 | } 62 | 63 | var content = hit._highlightResult.content; 64 | if (content) { 65 | words = words.concat(content.matchedWords); 66 | } 67 | 68 | // return unique words 69 | var words_uniq = [...new Set(words)]; 70 | return words_uniq; 71 | } 72 | 73 | function updateHitURL(hit) { 74 | 75 | var words = matchedWords(hit); 76 | var url = ""; 77 | 78 | if (hit.anchor) { 79 | url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; 80 | } else { 81 | url = hit.url + '?q=' + escape(words.join(" ")); 82 | } 83 | 84 | return url; 85 | } 86 | -------------------------------------------------------------------------------- /man/eventlog.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/eventlog.R 3 | \name{eventlog} 4 | \alias{eventlog} 5 | \alias{ieventlog} 6 | \title{Eventlog} 7 | \usage{ 8 | eventlog(eventlog, case_id = NULL, activity_id = NULL, 9 | activity_instance_id = NULL, lifecycle_id = NULL, timestamp = NULL, 10 | resource_id = NULL, order = "auto") 11 | 12 | ieventlog(eventlog) 13 | } 14 | \arguments{ 15 | \item{eventlog}{The data object to be used as event log. This can be a 16 | \code{data.frame} or \code{tbl_df}.} 17 | 18 | \item{case_id}{The case classifier of the event log. A character vector containing variable names of length 1 or more.} 19 | 20 | \item{activity_id}{The activity classifier of the event log. A character vector containing variable names of length 1 or more.} 21 | 22 | \item{activity_instance_id}{The activity instance classifier of the event log.} 23 | 24 | \item{lifecycle_id}{The life cycle classifier of the event log.} 25 | 26 | \item{timestamp}{The timestamp of the event log. Should refer to a Date or POSIXct field.} 27 | 28 | \item{resource_id}{The resource identifier of the event log. A character vector containing variable names of length 1 or more.} 29 | 30 | \item{order}{Configure how to handle sort events with equal timestamps: 31 | auto will use the order in the original data, 32 | alphabetical will sort the activity labels by alpabath, 33 | providing a column name will use this column for ordering (can be numeric of character). 34 | The latter will never overrule timestamp orderings.} 35 | } 36 | \description{ 37 | A function to instantiate an object of class \code{eventlog} by specifying a 38 | \code{data.frame} or \code{tbl_df} and appropriate case, activity and 39 | timestamp classifiers. 40 | } 41 | \examples{ 42 | \dontrun{ 43 | data <- data.frame(case = rep("A",5), 44 | activity_id = c("A","B","C","D","E"), 45 | activity_instance_id = 1:5, 46 | lifecycle_id = rep("complete",5), 47 | timestamp = 1:5, 48 | resource = rep("resource 1", 5)) 49 | eventlog(data,case_id = "case", 50 | activity_id = "activity_id", 51 | activity_instance_id = "activity_instance_id", 52 | lifecycle_id = "lifecycle_id", 53 | timestamp = "timestamp", 54 | resource_id = "resource") 55 | } 56 | } 57 | \seealso{ 58 | \code{\link{case_id}}, \code{\link{activity_id}}, 59 | \code{\link{activity_instance_id}},\code{\link{lifecycle_id}}, 60 | \code{\link{timestamp}} 61 | } 62 | -------------------------------------------------------------------------------- /R/add_start_end_activity.R: -------------------------------------------------------------------------------- 1 | #' Add artificial start/end activities to 2 | #' 3 | #' @param eventlog Event log 4 | #' @param label Start/end activity label 5 | #' 6 | #' @name add_end_activity 7 | #' 8 | #' @importFrom forcats fct_expand 9 | #' @export add_end_activity 10 | add_end_activity <- function(eventlog, label) { 11 | UseMethod("add_end_activity") 12 | } 13 | 14 | #' @rdname add_end_activity 15 | #' @export 16 | add_start_activity <- function(eventlog, label) { 17 | UseMethod("add_start_activity") 18 | } 19 | 20 | #' @describeIn add_end_activity Add end activity to event log 21 | #' @export 22 | add_end_activity.eventlog <- function(eventlog, label = "End") { 23 | 24 | eventlog %>% 25 | group_by_case() %>% 26 | arrange(desc(!!timestamp_(eventlog))) %>% 27 | slice_events.grouped_eventlog(1) %>% 28 | ungroup_eventlog() %>% 29 | mutate(!!timestamp_(eventlog) := !!timestamp_(eventlog) + 1, 30 | !!activity_id_(eventlog) := factor(label, levels = c(as.character(activity_labels(eventlog)), label)), 31 | !!activity_instance_id_(eventlog) := paste0(!!case_id_(eventlog), "-end")) -> end_states 32 | 33 | 34 | 35 | eventlog %>% 36 | mutate(!!activity_id_(eventlog) := fct_expand(!!activity_id_(eventlog), label)) %>% 37 | bind_rows(end_states) %>% 38 | re_map(mapping(eventlog)) 39 | 40 | } 41 | 42 | #' @describeIn add_end_activity Add end activity to grouped event log 43 | #' @export 44 | add_end_activity.grouped_eventlog <- function(eventlog, label = "End") { 45 | 46 | groups <- groups(eventlog) 47 | mapping <- mapping(eventlog) 48 | eventlog %>% 49 | as.data.frame() %>% 50 | re_map(mapping) %>% 51 | add_end_activity.eventlog(label = label) %>% 52 | group_by_at(vars(one_of(paste(groups)))) 53 | 54 | } 55 | 56 | #' @describeIn add_end_activity Add start activity to event log 57 | #' @export 58 | add_start_activity.eventlog <- function(eventlog, label = "Start") { 59 | 60 | eventlog %>% 61 | group_by_case() %>% 62 | arrange(!!timestamp_(eventlog)) %>% 63 | slice_events.grouped_eventlog(1) %>% 64 | ungroup_eventlog() %>% 65 | mutate(!!timestamp_(eventlog) := !!timestamp_(eventlog) - 1, 66 | !!activity_id_(eventlog) := factor(label, levels = c(as.character(activity_labels(eventlog)), label)), 67 | !!activity_instance_id_(eventlog) := paste0(!!case_id_(eventlog), "-start")) -> end_states 68 | 69 | 70 | 71 | eventlog %>% 72 | mutate(!!activity_id_(eventlog) := fct_expand(!!activity_id_(eventlog), label)) %>% 73 | bind_rows(end_states) %>% 74 | re_map(mapping(eventlog)) 75 | 76 | } 77 | 78 | #' @describeIn add_end_activity Add start activity to grouped event log 79 | #' @export 80 | add_start_activity.grouped_eventlog <- function(eventlog, label = "Start") { 81 | 82 | groups <- groups(eventlog) 83 | mapping <- mapping(eventlog) 84 | eventlog %>% 85 | as.data.frame() %>% 86 | re_map(mapping) %>% 87 | add_start_activity.eventlog(label = label) %>% 88 | group_by_at(vars(one_of(paste(groups)))) 89 | 90 | } 91 | 92 | -------------------------------------------------------------------------------- /R/traces.R: -------------------------------------------------------------------------------- 1 | #' @title Traces 2 | #' 3 | #' @description \code{traces} computes the different activity sequences of an event log 4 | #' together with their absolute and relative frequencies. 5 | #' Activity sequences are based on the start timestamp of activities. 6 | #' 7 | #' @param eventlog The event log to be used. An object of class 8 | #' \code{eventlog}. 9 | #' 10 | #' @param ... Deprecated arguments 11 | #' 12 | #' @seealso \code{\link{cases}}, \code{\link{eventlog}} 13 | #' 14 | 15 | 16 | #' @export traces 17 | 18 | traces <- function(eventlog,...) { 19 | UseMethod("traces") 20 | } 21 | 22 | #' @describeIn traces Construct traces list for eventlog 23 | #' @export 24 | 25 | traces.eventlog <- function(eventlog, ...){ 26 | 27 | if (exists("output_cases")) { 28 | warning("argument output_cases is deprecated, please use function cases instead", 29 | call. = FALSE) 30 | } 31 | if (exists("output_traces")) { 32 | warning("argument output_traces is deprecated", 33 | call. = FALSE) 34 | } 35 | 36 | trace_list(eventlog) 37 | # 38 | # eDT <- data.table::as.data.table(eventlog) 39 | # cases <- eDT[, 40 | # list("timestamp_classifier" = min(get(timestamp(eventlog))), "min_order" = min(.order)), 41 | # by = list("A" = get(case_id(eventlog)), "B" = get(activity_instance_id(eventlog)), "C" = get(activity_id(eventlog)))] 42 | # cases <- cases[order(get("timestamp_classifier"), get("min_order")), 43 | # list(trace = paste(get("C"), collapse = ",")), 44 | # by = list("CASE" = get("A"))] 45 | # cases <- cases %>% mutate(trace_id = as.numeric(factor(!!as.symbol("trace")))) %>% 46 | # rename(!!as.symbol(case_id(eventlog)) := "CASE") 47 | # # cases <- eventlog %>% 48 | # # group_by(case_classifier, activity_instance_classifier, event_classifier) %>% 49 | # # summarize(timestamp_classifier = min(timestamp_classifier)) %>% 50 | # # group_by(case_classifier) %>% 51 | # # arrange(timestamp_classifier) %>% 52 | # # summarize(trace = paste(event_classifier, collapse = ",")) %>% 53 | # # mutate(trace_id = as.numeric(factor(trace))) 54 | # 55 | # 56 | # .N <- NULL 57 | # absolute_frequency <- NULL 58 | # relative_frequency <- NULL 59 | # trace_id <- NULL 60 | # 61 | # casesDT <- data.table(cases) 62 | # cases <- cases %>% data.frame 63 | # traces <- casesDT[, .(absolute_frequency = .N), by = .(trace, trace_id)] 64 | # traces <- traces[order(absolute_frequency, decreasing = T),relative_frequency:=absolute_frequency/sum(absolute_frequency)] 65 | # traces <- tbl_df(traces) 66 | # #traces <- cases %>% 67 | # # group_by(trace, trace_id) %>% 68 | # # summarize(absolute_frequency = n()) %>% 69 | # # ungroup() %>% 70 | # # arrange(desc(absolute_frequency)) %>% 71 | # # mutate(relative_frequency = absolute_frequency/sum(absolute_frequency)) 72 | # 73 | # return(traces) 74 | } 75 | 76 | #' @describeIn traces Construct list of traces for grouped eventlog 77 | #' @export 78 | #' 79 | traces.grouped_eventlog <- function(eventlog, ...) { 80 | mapping <- mapping(eventlog) 81 | 82 | eventlog %>% 83 | nest() %>% 84 | mutate(data = map(data, re_map, mapping)) %>% 85 | mutate(data = map(data, traces)) %>% 86 | unnest() %>% 87 | return() 88 | } 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /R/slice.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Slice function for event log 2 | #' @param .data Eventlog 3 | #' @param ... Additional Arguments 4 | #' @name slice 5 | #' @importFrom dplyr slice 6 | #' @export 7 | dplyr::slice 8 | 9 | #' @describeIn slice Slice n cases of an eventlog 10 | #' @export 11 | 12 | slice.eventlog <- function(.data, ...) { 13 | 14 | .data %>% 15 | pull(!!as.symbol(case_id(.data))) %>% 16 | unique() %>% 17 | .[...] -> selection 18 | .data %>% 19 | filter((!!as.symbol(case_id(.data))) %in% selection) 20 | } 21 | 22 | #' @describeIn slice Slice grouped eventlog: take slice of cases from each group. 23 | #' @export 24 | 25 | slice.grouped_eventlog <- function(.data, ...) { 26 | 27 | mapping <- mapping(.data) 28 | 29 | .data %>% 30 | nest() %>% 31 | mutate(data = map(data, re_map, mapping)) %>% 32 | mutate(data = map(data, slice, ...)) %>% 33 | unnest() %>% 34 | re_map(mapping) %>% 35 | return() 36 | } 37 | 38 | #' @title Slice Events 39 | #' @description Take a slice of events from event log 40 | #' @param .data Eventlog 41 | #' @param ... Slice index 42 | #' @export slice_events 43 | slice_events <- function(.data, ...) { 44 | UseMethod("slice_events") 45 | } 46 | #' @describeIn slice_events Take a slice of events from event log 47 | #' @export 48 | 49 | slice_events.eventlog <- function(.data, ...) { 50 | mapping <- mapping(.data) 51 | .data %>% 52 | as.data.frame %>% 53 | dplyr::slice(...) %>% 54 | re_map(mapping) 55 | } 56 | #' @describeIn slice_events Take a slice of events from grouped event log 57 | #' @export 58 | slice_events.grouped_eventlog <- function(.data, ...) { 59 | groups <- groups(.data) 60 | mapping <- mapping(.data) 61 | .data %>% 62 | nest() %>% 63 | mutate(data = map(data, as.data.frame)) %>% 64 | mutate(data = map(data, dplyr::slice, ...)) %>% 65 | unnest() %>% 66 | re_map(mapping) %>% 67 | group_by_at(vars(one_of(paste(groups)))) 68 | } 69 | 70 | 71 | #' @title Slice Activities 72 | #' @description Take a slice of activity instances from event log 73 | #' @param .data Eventlog 74 | #' @param ... Slice index 75 | #' @export slice_activities 76 | slice_activities <- function(.data, ...) { 77 | UseMethod("slice_activities") 78 | } 79 | #' @describeIn slice_activities Take a slice of activity instances from event log 80 | #' @export 81 | 82 | slice_activities.eventlog <- function(.data, ...) { 83 | mapping <- mapping(.data) 84 | .data %>% 85 | slice_activities_raw(activity_instance_id(.data), ...) %>% 86 | re_map(mapping) 87 | } 88 | 89 | slice_activities_raw <- function(.data, .activity_instance_id, ...) { 90 | .data %>% 91 | pull(!!sym(.activity_instance_id)) %>% 92 | unique() %>% 93 | .[...] -> selection 94 | .data %>% 95 | filter(!!sym(.activity_instance_id) %in% selection) 96 | } 97 | 98 | 99 | 100 | #' @describeIn slice_activities Take a slice of activity instances from grouped event log 101 | #' @export 102 | slice_activities.grouped_eventlog <- function(.data, ...) { 103 | groups <- groups(.data) 104 | mapping <- mapping(.data) 105 | aid <- activity_instance_id(.data) 106 | .data %>% 107 | nest() %>% 108 | mutate(data = map(data, slice_activities_raw, aid, ...)) %>% 109 | unnest() %>% 110 | re_map(mapping) %>% 111 | group_by_at(vars(one_of(paste(groups)))) 112 | } 113 | -------------------------------------------------------------------------------- /R/simple_eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Simple Eventlog 2 | #' 3 | #' @description A function to instantiate an object of class \code{eventlog} by specifying a 4 | #' \code{data.frame} or \code{tbl_df} and the minimally required case identifier, activity identifier and timestamp 5 | #' 6 | #' 7 | #' @param eventlog The data object to be used as event log. This can be a 8 | #' \code{data.frame} or \code{tbl_df}. 9 | #' 10 | #' @param case_id The case classifier of the event log. 11 | #' 12 | #' @param activity_id The activity classifier of the event log. 13 | #' 14 | #' @param timestamp The timestamp of the event log. 15 | #' 16 | #' 17 | #'@param order Configure how to handle sort events with equal timestamps: 18 | #' auto will use the order in the original data, 19 | #' alphabetical will sort the activity labels by alpabath, 20 | #' providing a column name will use this column for ordering (can be numeric of character). 21 | #' The latter will never overrule timestamp orderings. 22 | #' 23 | #' 24 | #' @seealso \code{\link{eventlog}},\code{\link{case_id}}, \code{\link{activity_id}}, 25 | #' \code{\link{activity_instance_id}},\code{\link{lifecycle_id}}, 26 | #' \code{\link{timestamp}} 27 | #' 28 | #' @examples 29 | #' \dontrun{ 30 | #' data <- data.frame(case = rep("A",5), 31 | #' activity_id = c("A","B","C","D","E"), 32 | #' timestamp = date_decimal(1:5)) 33 | #' simple_eventlog(data,case_id = "case", 34 | #' activity_id = "activity_id", 35 | #' timestamp = "timestamp") 36 | #'} 37 | #' @export simple_eventlog 38 | 39 | 40 | simple_eventlog <- function(eventlog, 41 | case_id = NULL, 42 | activity_id = NULL, 43 | timestamp = NULL, 44 | order = "auto"){ 45 | 46 | eventlog <- tbl_df(as.data.frame(eventlog)) %>% 47 | mutate(activity_instance_id = 1:nrow(.), 48 | resource_id = "undefined", 49 | lifecycle_id = "undefined") 50 | 51 | resource_id <- "resource_id" 52 | activity_instance_id <- "activity_instance_id" 53 | lifecycle_id = "lifecycle_id" 54 | 55 | 56 | eventlog(eventlog, 57 | case_id, 58 | activity_id, 59 | activity_instance_id, 60 | lifecycle_id, 61 | timestamp, 62 | resource_id, 63 | order = order) %>% 64 | return() 65 | } 66 | #' @rdname simple_eventlog 67 | #' @export isimple_eventlog 68 | isimple_eventlog <- function(eventlog){ 69 | 70 | ui <- miniPage( 71 | gadgetTitleBar("Create eventlog"), 72 | miniContentPanel( 73 | fillRow(fillCol( 74 | selectizeInput("case_id", "Case identifier", choices = c("",colnames(eventlog)), 75 | selected = ifelse(is.null(attr(eventlog, "case_id")), NA, attr(eventlog, "case_id"))), 76 | selectizeInput("activity_id", "Activity identifier", choices = c("",colnames(eventlog)), 77 | selected = ifelse(is.null(attr(eventlog, "activity_id")), NA, attr(eventlog, "activity_id"))), 78 | selectizeInput("timestamp", "Timestamp", choices = c("",colnames(eventlog)), 79 | selected = ifelse(is.null(attr(eventlog, "timestamp")), NA, attr(eventlog, "timestamp")))) 80 | 81 | )) 82 | ) 83 | 84 | server <- function(input, output, session){ 85 | observeEvent(input$done, { 86 | stopApp(simple_eventlog(eventlog = eventlog, 87 | case_id = input$case_id, 88 | activity_id = input$activity_id, 89 | timestamp = input$timestamp)) 90 | }) 91 | 92 | 93 | } 94 | 95 | runGadget(ui, server, viewer = dialogViewer("Create simple event log", height = 400)) 96 | 97 | } 98 | 99 | -------------------------------------------------------------------------------- /man/set_case_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/set_eventlog_attributes.R 3 | \name{set_case_id} 4 | \alias{set_case_id} 5 | \alias{set_activity_id} 6 | \alias{set_activity_instance_id} 7 | \alias{set_timestamp} 8 | \alias{set_resource_id} 9 | \alias{set_lifecycle_id} 10 | \alias{set_case_id.eventlog} 11 | \alias{set_case_id.grouped_eventlog} 12 | \alias{set_activity_id.eventlog} 13 | \alias{set_activity_id.grouped_eventlog} 14 | \alias{set_activity_instance_id.eventlog} 15 | \alias{set_activity_instance_id.grouped_eventlog} 16 | \alias{set_timestamp.eventlog} 17 | \alias{set_timestamp.grouped_eventlog} 18 | \alias{set_resource_id.eventlog} 19 | \alias{set_resource_id.grouped_eventlog} 20 | \alias{set_lifecycle_id.eventlog} 21 | \alias{set_lifecycle_id.grouped_eventlog} 22 | \title{Set individual attributes of event log} 23 | \usage{ 24 | set_case_id(eventlog, case_id) 25 | 26 | set_activity_id(eventlog, activity_id) 27 | 28 | set_activity_instance_id(eventlog, activity_instance_id) 29 | 30 | set_timestamp(eventlog, timestamp) 31 | 32 | set_resource_id(eventlog, resource_id) 33 | 34 | set_lifecycle_id(eventlog, lifecycle_id) 35 | 36 | \method{set_case_id}{eventlog}(eventlog, case_id) 37 | 38 | \method{set_case_id}{grouped_eventlog}(eventlog, case_id) 39 | 40 | \method{set_activity_id}{eventlog}(eventlog, activity_id) 41 | 42 | \method{set_activity_id}{grouped_eventlog}(eventlog, activity_id) 43 | 44 | \method{set_activity_instance_id}{eventlog}(eventlog, activity_instance_id) 45 | 46 | \method{set_activity_instance_id}{grouped_eventlog}(eventlog, 47 | activity_instance_id) 48 | 49 | \method{set_timestamp}{eventlog}(eventlog, timestamp) 50 | 51 | \method{set_timestamp}{grouped_eventlog}(eventlog, timestamp) 52 | 53 | \method{set_resource_id}{eventlog}(eventlog, resource_id) 54 | 55 | \method{set_resource_id}{grouped_eventlog}(eventlog, resource_id) 56 | 57 | \method{set_lifecycle_id}{eventlog}(eventlog, lifecycle_id) 58 | 59 | \method{set_lifecycle_id}{grouped_eventlog}(eventlog, lifecycle_id) 60 | } 61 | \arguments{ 62 | \item{eventlog}{Event log object} 63 | 64 | \item{case_id}{New case id} 65 | 66 | \item{activity_id}{New activity id} 67 | 68 | \item{activity_instance_id}{New activity instance id} 69 | 70 | \item{timestamp}{New timestamp} 71 | 72 | \item{resource_id}{New resource id} 73 | 74 | \item{lifecycle_id}{New lifecycle id} 75 | } 76 | \description{ 77 | Set individual attributes of event log 78 | } 79 | \section{Methods (by class)}{ 80 | \itemize{ 81 | \item \code{eventlog}: Set case id of event log 82 | 83 | \item \code{grouped_eventlog}: Set case id of grouped event log 84 | 85 | \item \code{eventlog}: Set activity id of event log 86 | 87 | \item \code{grouped_eventlog}: Set activity id of grouped event log 88 | 89 | \item \code{eventlog}: Set activity instance id of event log 90 | 91 | \item \code{grouped_eventlog}: Set activity instance id of grouped event log 92 | 93 | \item \code{eventlog}: Set timestamp of event log 94 | 95 | \item \code{grouped_eventlog}: Set timestamp of grouped event log 96 | 97 | \item \code{eventlog}: Set resource_id of event log 98 | 99 | \item \code{grouped_eventlog}: Set resource_id of grouped event log 100 | 101 | \item \code{eventlog}: Set lifecycle_id of event log 102 | 103 | \item \code{grouped_eventlog}: Set lifecycle_id of grouped event log 104 | }} 105 | 106 | -------------------------------------------------------------------------------- /docs/pkgdown.js: -------------------------------------------------------------------------------- 1 | /* http://gregfranko.com/blog/jquery-best-practices/ */ 2 | (function($) { 3 | $(function() { 4 | 5 | $("#sidebar") 6 | .stick_in_parent({offset_top: 40}) 7 | .on('sticky_kit:bottom', function(e) { 8 | $(this).parent().css('position', 'static'); 9 | }) 10 | .on('sticky_kit:unbottom', function(e) { 11 | $(this).parent().css('position', 'relative'); 12 | }); 13 | 14 | $('body').scrollspy({ 15 | target: '#sidebar', 16 | offset: 60 17 | }); 18 | 19 | $('[data-toggle="tooltip"]').tooltip(); 20 | 21 | var cur_path = paths(location.pathname); 22 | var links = $("#navbar ul li a"); 23 | var max_length = -1; 24 | var pos = -1; 25 | for (var i = 0; i < links.length; i++) { 26 | if (links[i].getAttribute("href") === "#") 27 | continue; 28 | var path = paths(links[i].pathname); 29 | 30 | var length = prefix_length(cur_path, path); 31 | if (length > max_length) { 32 | max_length = length; 33 | pos = i; 34 | } 35 | } 36 | 37 | // Add class to parent
  • , and enclosing
  • if in dropdown 38 | if (pos >= 0) { 39 | var menu_anchor = $(links[pos]); 40 | menu_anchor.parent().addClass("active"); 41 | menu_anchor.closest("li.dropdown").addClass("active"); 42 | } 43 | }); 44 | 45 | function paths(pathname) { 46 | var pieces = pathname.split("/"); 47 | pieces.shift(); // always starts with / 48 | 49 | var end = pieces[pieces.length - 1]; 50 | if (end === "index.html" || end === "") 51 | pieces.pop(); 52 | return(pieces); 53 | } 54 | 55 | function prefix_length(needle, haystack) { 56 | if (needle.length > haystack.length) 57 | return(0); 58 | 59 | // Special case for length-0 haystack, since for loop won't run 60 | if (haystack.length === 0) { 61 | return(needle.length === 0 ? 1 : 0); 62 | } 63 | 64 | for (var i = 0; i < haystack.length; i++) { 65 | if (needle[i] != haystack[i]) 66 | return(i); 67 | } 68 | 69 | return(haystack.length); 70 | } 71 | 72 | /* Clipboard --------------------------*/ 73 | 74 | function changeTooltipMessage(element, msg) { 75 | var tooltipOriginalTitle=element.getAttribute('data-original-title'); 76 | element.setAttribute('data-original-title', msg); 77 | $(element).tooltip('show'); 78 | element.setAttribute('data-original-title', tooltipOriginalTitle); 79 | } 80 | 81 | if(Clipboard.isSupported()) { 82 | $(document).ready(function() { 83 | var copyButton = ""; 84 | 85 | $(".examples, div.sourceCode").addClass("hasCopyButton"); 86 | 87 | // Insert copy buttons: 88 | $(copyButton).prependTo(".hasCopyButton"); 89 | 90 | // Initialize tooltips: 91 | $('.btn-copy-ex').tooltip({container: 'body'}); 92 | 93 | // Initialize clipboard: 94 | var clipboardBtnCopies = new Clipboard('[data-clipboard-copy]', { 95 | text: function(trigger) { 96 | return trigger.parentNode.textContent; 97 | } 98 | }); 99 | 100 | clipboardBtnCopies.on('success', function(e) { 101 | changeTooltipMessage(e.trigger, 'Copied!'); 102 | e.clearSelection(); 103 | }); 104 | 105 | clipboardBtnCopies.on('error', function() { 106 | changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); 107 | }); 108 | }); 109 | } 110 | })(window.jQuery || window.$) 111 | -------------------------------------------------------------------------------- /R/group_by.eventlog.R: -------------------------------------------------------------------------------- 1 | #' @title Group event log 2 | #' @name group_by 3 | #' @param .data Eventlog 4 | #' @param ... Variables to group by 5 | #' @param add Add grouping variables to existing ones 6 | #' @importFrom dplyr group_by 7 | #' @export 8 | dplyr::group_by 9 | #' @describeIn group_by Group eventlog 10 | #' @export 11 | group_by.eventlog <- function(.data, ..., add = F) { 12 | 13 | 14 | mapping <- mapping(.data) 15 | x <- NextMethod(.data, ..., add = add) 16 | class(x) <- c("grouped_eventlog","eventlog", class(x)) 17 | 18 | 19 | # map(groups, ~names(mapping)[.x == mapping]) %>% 20 | # .[lengths(.)>0] %>% 21 | # as.character() -> t 22 | # print(t) 23 | # 24 | # if(length(t) > 0) { 25 | # warning(glue::glue("Grouping includes mapped variables {paste(t, collapse = \", \")}. 26 | # Might produce unexpected behavior. Use provided analysis levels instead.")) 27 | # } 28 | 29 | return(x) 30 | 31 | } 32 | #' @title Group event log on case id 33 | #' @description Group an event log by case identifier 34 | #' @param eventlog Eventlog 35 | #' @export group_by_case 36 | group_by_case <- function(eventlog) { 37 | UseMethod("group_by_case") 38 | } 39 | #' @describeIn group_by_case Group eventlog on case identifier 40 | #' @export 41 | group_by_case.eventlog <- function(eventlog) { 42 | group_by(eventlog, !!as.symbol(case_id(eventlog))) 43 | } 44 | #' @title Group event log on activity id 45 | #' @description Group an event log by activity identifier 46 | #' @param eventlog Eventlog 47 | #' @export group_by_activity 48 | group_by_activity <- function(eventlog) { 49 | UseMethod("group_by_activity") 50 | } 51 | #' @describeIn group_by_activity Group eventlog on activity identifier 52 | #' @export 53 | group_by_activity.eventlog <- function(eventlog) { 54 | group_by(eventlog, !!as.symbol(activity_id(eventlog))) 55 | } 56 | 57 | 58 | #' @title Group event log on activity instance id 59 | #' @description Group an event log by activity instance identifier 60 | #' @param eventlog Eventlog 61 | #' @export group_by_activity_instance 62 | group_by_activity_instance <- function(eventlog) { 63 | UseMethod("group_by_activity_instance") 64 | } 65 | #' @describeIn group_by_activity_instance Group eventlog on activity instance identifier 66 | #' @export 67 | group_by_activity_instance.eventlog <- function(eventlog) { 68 | group_by(eventlog, !!as.symbol(activity_instance_id(eventlog))) 69 | } 70 | 71 | 72 | 73 | #' @title Group event log on resource id 74 | #' @description Group an event log by resource identifier 75 | #' @param eventlog Eventlog 76 | #' @export group_by_resource 77 | group_by_resource <- function(eventlog) { 78 | UseMethod("group_by_resource") 79 | } 80 | #' @describeIn group_by_resource Group eventlog on resource identifier 81 | #' @export 82 | group_by_resource.eventlog <- function(eventlog) { 83 | group_by(eventlog, !!as.symbol(resource_id(eventlog))) 84 | } 85 | 86 | 87 | #' @title Group event log on resource and activity id 88 | #' @description Group an event log by resource and activity identifier 89 | #' @param eventlog Eventlog 90 | #' @export group_by_resource_activity 91 | group_by_resource_activity <- function(eventlog) { 92 | UseMethod("group_by_resource_activity") 93 | } 94 | #' @describeIn group_by_resource_activity Group an event log by resource and activity identifier 95 | #' @export 96 | group_by_resource_activity.eventlog <- function(eventlog) { 97 | group_by(eventlog, !!as.symbol(resource_id(eventlog)), !!as.symbol(activity_id(eventlog))) 98 | } 99 | 100 | 101 | 102 | #' @title Ungroup event log 103 | #' @name ungroup_eventlog 104 | #' @description Remove groups from event log 105 | #' @param eventlog Eventlog 106 | #' @export ungroup_eventlog 107 | ungroup_eventlog <- function(eventlog) { 108 | UseMethod("ungroup_eventlog") 109 | } 110 | #' @describeIn ungroup_eventlog Remove groups from event log 111 | #' @export 112 | ungroup_eventlog.eventlog <- function(eventlog) { 113 | eventlog %>% 114 | as.data.frame %>% 115 | re_map(mapping(eventlog)) 116 | } 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /docs/LICENSE-text.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | License • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 |
    50 |
    51 | 85 | 86 | 87 |
    88 | 89 |
    90 |
    91 | 94 | 95 |
    YEAR: 2017
     96 | COPYRIGHT HOLDER: Hasselt University
     97 | 
     98 | 
    99 | 100 |
    101 | 102 |
    103 | 104 | 105 |
    106 | 109 | 110 |
    111 |

    Site built with pkgdown.

    112 |
    113 | 114 |
    115 |
    116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /docs/authors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Authors • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 |
    50 |
    51 | 85 | 86 | 87 |
    88 | 89 |
    90 |
    91 | 94 | 95 |
      96 |
    • 97 |

      Gert Janssenswillen. Author, maintainer. 98 |

      99 |
    • 100 |
    101 | 102 |
    103 | 104 |
    105 | 106 | 107 |
    108 | 111 | 112 |
    113 |

    Site built with pkgdown.

    114 |
    115 | 116 |
    117 |
    118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /R/set_eventlog_attributes.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #' Set individual attributes of event log 5 | #' 6 | #' @param eventlog Event log object 7 | #' @param case_id New case id 8 | #' @param activity_id New activity id 9 | #' @param activity_instance_id New activity instance id 10 | #' @param resource_id New resource id 11 | #' @param lifecycle_id New lifecycle id 12 | #' @param timestamp New timestamp 13 | #' @name set_case_id 14 | #' 15 | 16 | 17 | 18 | ## CASE ID 19 | 20 | #' @export 21 | #' 22 | set_case_id <- function(eventlog, case_id) { 23 | UseMethod("set_case_id") 24 | } 25 | #' @rdname set_case_id 26 | #' @export 27 | #' 28 | set_activity_id <- function(eventlog, activity_id) { 29 | UseMethod("set_activity_id") 30 | } 31 | #' @rdname set_case_id 32 | #' @export 33 | #' 34 | set_activity_instance_id <- function(eventlog, activity_instance_id) { 35 | UseMethod("set_activity_instance_id") 36 | } 37 | #' @rdname set_case_id 38 | #' @export 39 | #' 40 | set_timestamp <- function(eventlog, timestamp) { 41 | UseMethod("set_timestamp") 42 | } 43 | 44 | #' @rdname set_case_id 45 | #' @export 46 | #' 47 | set_resource_id <- function(eventlog, resource_id) { 48 | UseMethod("set_resource_id") 49 | } 50 | 51 | #' @rdname set_case_id 52 | #' @export 53 | #' 54 | set_lifecycle_id <- function(eventlog, lifecycle_id) { 55 | UseMethod("set_lifecycle_id") 56 | } 57 | 58 | 59 | #' @describeIn set_case_id Set case id of event log 60 | #' @export 61 | set_case_id.eventlog <- function(eventlog, case_id) { 62 | eventlog %>% 63 | eventlog(case_id = case_id) 64 | } 65 | #' @describeIn set_case_id Set case id of grouped event log 66 | #' @export 67 | set_case_id.grouped_eventlog <- function(eventlog, case_id) { 68 | groups <- groups(eventlog) 69 | eventlog %>% 70 | eventlog(case_id = case_id) %>% 71 | group_by_at(vars(one_of(paste(groups)))) 72 | } 73 | 74 | ## ACTIVITY ID 75 | 76 | #' @describeIn set_case_id Set activity id of event log 77 | #' @export 78 | set_activity_id.eventlog <- function(eventlog, activity_id) { 79 | eventlog %>% 80 | eventlog(activity_id = activity_id) 81 | } 82 | #' @describeIn set_case_id Set activity id of grouped event log 83 | #' @export 84 | set_activity_id.grouped_eventlog <- function(eventlog, activity_id) { 85 | groups <- groups(eventlog) 86 | eventlog %>% 87 | eventlog(activity_id = activity_id) %>% 88 | group_by_at(vars(one_of(paste(groups)))) 89 | } 90 | 91 | ## ACTIVITY INSTANCE ID 92 | 93 | #' @describeIn set_case_id Set activity instance id of event log 94 | #' @export 95 | set_activity_instance_id.eventlog <- function(eventlog, activity_instance_id) { 96 | eventlog %>% 97 | eventlog(activity_instance_id = activity_instance_id) 98 | } 99 | #' @describeIn set_case_id Set activity instance id of grouped event log 100 | #' @export 101 | set_activity_instance_id.grouped_eventlog <- function(eventlog, activity_instance_id) { 102 | groups <- groups(eventlog) 103 | eventlog %>% 104 | eventlog(activity_instance_id = activity_instance_id) %>% 105 | group_by_at(vars(one_of(paste(groups)))) 106 | } 107 | 108 | ## TIMESTAMP 109 | 110 | #' @describeIn set_case_id Set timestamp of event log 111 | #' @export 112 | set_timestamp.eventlog <- function(eventlog, timestamp) { 113 | eventlog %>% 114 | eventlog(timestamp = timestamp) 115 | } 116 | #' @describeIn set_case_id Set timestamp of grouped event log 117 | #' @export 118 | set_timestamp.grouped_eventlog <- function(eventlog, timestamp) { 119 | groups <- groups(eventlog) 120 | eventlog %>% 121 | eventlog(timestamp = timestamp) %>% 122 | group_by_at(vars(one_of(paste(groups)))) 123 | } 124 | 125 | ## RESOURCE 126 | 127 | #' @describeIn set_case_id Set resource_id of event log 128 | #' @export 129 | set_resource_id.eventlog <- function(eventlog, resource_id) { 130 | eventlog %>% 131 | eventlog(resource_id = resource_id) 132 | } 133 | #' @describeIn set_case_id Set resource_id of grouped event log 134 | #' @export 135 | set_resource_id.grouped_eventlog <- function(eventlog, resource_id) { 136 | groups <- groups(eventlog) 137 | eventlog %>% 138 | eventlog(resource_id = resource_id) %>% 139 | group_by_at(vars(one_of(paste(groups)))) 140 | } 141 | 142 | ## LIFECYCLE ID 143 | 144 | #' @describeIn set_case_id Set lifecycle_id of event log 145 | #' @export 146 | set_lifecycle_id.eventlog <- function(eventlog, lifecycle_id) { 147 | eventlog %>% 148 | eventlog(lifecycle_id = lifecycle_id) 149 | } 150 | #' @describeIn set_case_id Set lifecycle_id of grouped event log 151 | #' @export 152 | set_lifecycle_id.grouped_eventlog <- function(eventlog, lifecycle_id) { 153 | groups <- groups(eventlog) 154 | eventlog %>% 155 | eventlog(lifecycle_id = lifecycle_id) %>% 156 | group_by_at(vars(one_of(paste(groups)))) 157 | } 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/reference/reexports.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Objects exported from other packages — reexports • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 52 | 53 | 54 | 55 | 56 |
    57 |
    58 | 92 | 93 | 94 |
    95 | 96 |
    97 |
    98 | 103 | 104 |
    105 | 106 |

    These objects are imported from other packages. Follow the links 107 | below to see their documentation.

    108 |
    109 |
    magrittr

    %>%

    110 |
    111 | 112 |
    113 | 114 | 115 | 116 |
    117 | 123 |
    124 | 125 |
    126 | 129 | 130 |
    131 |

    Site built with pkgdown.

    132 |
    133 | 134 |
    135 |
    136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /docs/pkgdown.css: -------------------------------------------------------------------------------- 1 | /* Sticky footer */ 2 | 3 | /** 4 | * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ 5 | * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css 6 | * 7 | * .Site -> body > .container 8 | * .Site-content -> body > .container .row 9 | * .footer -> footer 10 | * 11 | * Key idea seems to be to ensure that .container and __all its parents__ 12 | * have height set to 100% 13 | * 14 | */ 15 | 16 | html, body { 17 | height: 100%; 18 | } 19 | 20 | body > .container { 21 | display: flex; 22 | height: 100%; 23 | flex-direction: column; 24 | 25 | padding-top: 60px; 26 | } 27 | 28 | body > .container .row { 29 | flex: 1 0 auto; 30 | } 31 | 32 | footer { 33 | margin-top: 45px; 34 | padding: 35px 0 36px; 35 | border-top: 1px solid #e5e5e5; 36 | color: #666; 37 | display: flex; 38 | flex-shrink: 0; 39 | } 40 | footer p { 41 | margin-bottom: 0; 42 | } 43 | footer div { 44 | flex: 1; 45 | } 46 | footer .pkgdown { 47 | text-align: right; 48 | } 49 | footer p { 50 | margin-bottom: 0; 51 | } 52 | 53 | img.icon { 54 | float: right; 55 | } 56 | 57 | img { 58 | max-width: 100%; 59 | } 60 | 61 | /* Typographic tweaking ---------------------------------*/ 62 | 63 | .contents h1.page-header { 64 | margin-top: calc(-60px + 1em); 65 | } 66 | 67 | /* Section anchors ---------------------------------*/ 68 | 69 | a.anchor { 70 | margin-left: -30px; 71 | display:inline-block; 72 | width: 30px; 73 | height: 30px; 74 | visibility: hidden; 75 | 76 | background-image: url(./link.svg); 77 | background-repeat: no-repeat; 78 | background-size: 20px 20px; 79 | background-position: center center; 80 | } 81 | 82 | .hasAnchor:hover a.anchor { 83 | visibility: visible; 84 | } 85 | 86 | @media (max-width: 767px) { 87 | .hasAnchor:hover a.anchor { 88 | visibility: hidden; 89 | } 90 | } 91 | 92 | 93 | /* Fixes for fixed navbar --------------------------*/ 94 | 95 | .contents h1, .contents h2, .contents h3, .contents h4 { 96 | padding-top: 60px; 97 | margin-top: -40px; 98 | } 99 | 100 | /* Static header placement on mobile devices */ 101 | @media (max-width: 767px) { 102 | .navbar-fixed-top { 103 | position: absolute; 104 | } 105 | .navbar { 106 | padding: 0; 107 | } 108 | } 109 | 110 | 111 | /* Sidebar --------------------------*/ 112 | 113 | #sidebar { 114 | margin-top: 30px; 115 | } 116 | #sidebar h2 { 117 | font-size: 1.5em; 118 | margin-top: 1em; 119 | } 120 | 121 | #sidebar h2:first-child { 122 | margin-top: 0; 123 | } 124 | 125 | #sidebar .list-unstyled li { 126 | margin-bottom: 0.5em; 127 | } 128 | 129 | .orcid { 130 | height: 16px; 131 | vertical-align: middle; 132 | } 133 | 134 | /* Reference index & topics ----------------------------------------------- */ 135 | 136 | .ref-index th {font-weight: normal;} 137 | 138 | .ref-index td {vertical-align: top;} 139 | .ref-index .alias {width: 40%;} 140 | .ref-index .title {width: 60%;} 141 | 142 | .ref-index .alias {width: 40%;} 143 | .ref-index .title {width: 60%;} 144 | 145 | .ref-arguments th {text-align: right; padding-right: 10px;} 146 | .ref-arguments th, .ref-arguments td {vertical-align: top;} 147 | .ref-arguments .name {width: 20%;} 148 | .ref-arguments .desc {width: 80%;} 149 | 150 | /* Nice scrolling for wide elements --------------------------------------- */ 151 | 152 | table { 153 | display: block; 154 | overflow: auto; 155 | } 156 | 157 | /* Syntax highlighting ---------------------------------------------------- */ 158 | 159 | pre { 160 | word-wrap: normal; 161 | word-break: normal; 162 | border: 1px solid #eee; 163 | } 164 | 165 | pre, code { 166 | background-color: #f8f8f8; 167 | color: #333; 168 | } 169 | 170 | pre code { 171 | overflow: auto; 172 | word-wrap: normal; 173 | white-space: pre; 174 | } 175 | 176 | pre .img { 177 | margin: 5px 0; 178 | } 179 | 180 | pre .img img { 181 | background-color: #fff; 182 | display: block; 183 | height: auto; 184 | } 185 | 186 | code a, pre a { 187 | color: #375f84; 188 | } 189 | 190 | a.sourceLine:hover { 191 | text-decoration: none; 192 | } 193 | 194 | .fl {color: #1514b5;} 195 | .fu {color: #000000;} /* function */ 196 | .ch,.st {color: #036a07;} /* string */ 197 | .kw {color: #264D66;} /* keyword */ 198 | .co {color: #888888;} /* comment */ 199 | 200 | .message { color: black; font-weight: bolder;} 201 | .error { color: orange; font-weight: bolder;} 202 | .warning { color: #6A0366; font-weight: bolder;} 203 | 204 | /* Clipboard --------------------------*/ 205 | 206 | .hasCopyButton { 207 | position: relative; 208 | } 209 | 210 | .btn-copy-ex { 211 | position: absolute; 212 | right: 0; 213 | top: 0; 214 | visibility: hidden; 215 | } 216 | 217 | .hasCopyButton:hover button.btn-copy-ex { 218 | visibility: visible; 219 | } 220 | 221 | /* mark.js ----------------------------*/ 222 | 223 | mark { 224 | background-color: rgba(255, 255, 51, 0.5); 225 | border-bottom: 2px solid rgba(255, 153, 51, 0.3); 226 | padding: 1px; 227 | } 228 | 229 | /* vertical spacing after htmlwidgets */ 230 | .html-widget { 231 | margin-bottom: 10px; 232 | } 233 | -------------------------------------------------------------------------------- /docs/reference/bupaR.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | bupaR - Business Process Analysis in R — bupaR • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Functionalities for process analysis in R. This packages implements an S3-class for event log objects, and related handler functions. Imports related packages for subsetting event data, computation of descriptive statistics, handling of Petri Net objects and visualization of process maps.

    103 | 104 |
    105 | 106 | 107 | 108 |
    109 | 115 |
    116 | 117 |
    118 | 121 | 122 |
    123 |

    Site built with pkgdown.

    124 |
    125 | 126 |
    127 |
    128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /docs/reference/re_map.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Re map — re_map • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Construct and eventlog using an existing mapping.

    103 | 104 |
    105 | 106 |
    re_map(eventlog, eventlog_mapping)
    107 | 108 |

    Arguments

    109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 |
    eventlog

    The event log data to be used.

    eventlog_mapping

    An existing eventlog mapping created by the mapping function

    120 | 121 | 122 |
    123 | 130 |
    131 | 132 |
    133 | 136 | 137 |
    138 |

    Site built with pkgdown.

    139 |
    140 | 141 |
    142 |
    143 | 144 | 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /docs/reference/print.eventlog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Generic print function for eventlog — print.eventlog • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Generic print function for eventlog

    103 | 104 |
    105 | 106 |
    # S3 method for eventlog
    107 | print(x, ...)
    108 | 109 |

    Arguments

    110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 |
    x

    Eventlog object

    ...

    Additional Arguments

    121 | 122 | 123 |
    124 | 131 |
    132 | 133 |
    134 | 137 | 138 |
    139 |

    Site built with pkgdown.

    140 |
    141 | 142 |
    143 |
    144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/reference/print.eventlog_mapping.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Generic print function for eventlog_mapping — print.eventlog_mapping • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Generic print function for eventlog_mapping

    103 | 104 |
    105 | 106 |
    # S3 method for eventlog_mapping
    107 | print(x, ...)
    108 | 109 |

    Arguments

    110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 |
    x

    Eventlog mapping object

    ...

    Additional Arguments

    121 | 122 | 123 |
    124 | 131 |
    132 | 133 |
    134 | 137 | 138 |
    139 |

    Site built with pkgdown.

    140 |
    141 | 142 |
    143 |
    144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/reference/case_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Case list — case_list • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Construct list of cases

    103 | 104 |
    105 | 106 |
    case_list(eventlog)
    107 | 
    108 | # S3 method for eventlog
    109 | case_list(eventlog)
    110 | 111 |

    Arguments

    112 | 113 | 114 | 115 | 116 | 117 | 118 |
    eventlog

    Eventlog object

    119 | 120 |

    Methods (by class)

    121 | 122 |
      123 |
    • eventlog: Return case list

    • 124 |
    125 | 126 | 127 |
    128 | 137 |
    138 | 139 |
    140 | 143 | 144 |
    145 |

    Site built with pkgdown.

    146 |
    147 | 148 |
    149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Business Process Analysis in R • bupaR 9 | 10 | 11 | 12 | 13 | 14 | 15 | 19 | 20 | 21 |
    22 |
    54 | 55 | 56 | 57 |
    58 |
    59 |
    60 | 62 |

    bupaR is an open-source suite for the handling and analysis of business process data in R developed by the Business Informatics research group at Hasselt University, Belgium. It builds upon the concept of an event log which is a logbook of events which have happened and were recorded within the execution of a business process.

    63 |

    Read more

    64 |
    65 |
    66 | 67 | 93 |
    94 | 95 | 96 |
    99 | 100 |
    101 |

    Site built with pkgdown.

    102 |
    103 | 104 |
    105 |
    106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/reference/trace_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Trace list — trace_list • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Construct trace list

    103 | 104 |
    105 | 106 |
    trace_list(eventlog)
    107 | 
    108 | # S3 method for eventlog
    109 | trace_list(eventlog)
    110 | 111 |

    Arguments

    112 | 113 | 114 | 115 | 116 | 117 | 118 |
    eventlog

    Eventlog object

    119 | 120 |

    Methods (by class)

    121 | 122 |
      123 |
    • eventlog: Construct trace list for event log

    • 124 |
    125 | 126 | 127 |
    128 | 137 |
    138 | 139 |
    140 | 143 | 144 |
    145 |

    Site built with pkgdown.

    146 |
    147 | 148 |
    149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/reference/ungroup_eventlog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Ungroup event log — ungroup_eventlog • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Remove groups from event log

    103 | 104 |
    105 | 106 |
    ungroup_eventlog(eventlog)
    107 | 
    108 | # S3 method for eventlog
    109 | ungroup_eventlog(eventlog)
    110 | 111 |

    Arguments

    112 | 113 | 114 | 115 | 116 | 117 | 118 |
    eventlog

    Eventlog

    119 | 120 |

    Methods (by class)

    121 | 122 |
      123 |
    • eventlog: Remove groups from event log

    • 124 |
    125 | 126 | 127 |
    128 | 137 |
    138 | 139 |
    140 | 143 | 144 |
    145 |

    Site built with pkgdown.

    146 |
    147 | 148 |
    149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/reference/group_by_case.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Group event log on case id — group_by_case • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Group an event log by case identifier

    103 | 104 |
    105 | 106 |
    group_by_case(eventlog)
    107 | 
    108 | # S3 method for eventlog
    109 | group_by_case(eventlog)
    110 | 111 |

    Arguments

    112 | 113 | 114 | 115 | 116 | 117 | 118 |
    eventlog

    Eventlog

    119 | 120 |

    Methods (by class)

    121 | 122 |
      123 |
    • eventlog: Group eventlog on case identifier

    • 124 |
    125 | 126 | 127 |
    128 | 137 |
    138 | 139 |
    140 | 143 | 144 |
    145 |

    Site built with pkgdown.

    146 |
    147 | 148 |
    149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/reference/case_labels.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Get vector of case labels — case_labels • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Retrieve a vector containing all unique case labels

    103 | 104 |
    105 | 106 |
    case_labels(eventlog)
    107 | 
    108 | # S3 method for eventlog
    109 | case_labels(eventlog)
    110 | 111 |

    Arguments

    112 | 113 | 114 | 115 | 116 | 117 | 118 |
    eventlog

    Eventlog

    119 | 120 |

    Methods (by class)

    121 | 122 |
      123 |
    • eventlog: Retrieve case labels from eventlog

    • 124 |
    125 | 126 | 127 |
    128 | 137 |
    138 | 139 |
    140 | 143 | 144 |
    145 |

    Site built with pkgdown.

    146 |
    147 | 148 |
    149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/reference/group_by_activity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Group event log on activity id — group_by_activity • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Group an event log by activity identifier

    103 | 104 |
    105 | 106 |
    group_by_activity(eventlog)
    107 | 
    108 | # S3 method for eventlog
    109 | group_by_activity(eventlog)
    110 | 111 |

    Arguments

    112 | 113 | 114 | 115 | 116 | 117 | 118 |
    eventlog

    Eventlog

    119 | 120 |

    Methods (by class)

    121 | 122 |
      123 |
    • eventlog: Group eventlog on activity identifier

    • 124 |
    125 | 126 | 127 |
    128 | 137 |
    138 | 139 |
    140 | 143 | 144 |
    145 |

    Site built with pkgdown.

    146 |
    147 | 148 |
    149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/reference/group_by_resource.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Group event log on resource id — group_by_resource • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Group an event log by resource identifier

    103 | 104 |
    105 | 106 |
    group_by_resource(eventlog)
    107 | 
    108 | # S3 method for eventlog
    109 | group_by_resource(eventlog)
    110 | 111 |

    Arguments

    112 | 113 | 114 | 115 | 116 | 117 | 118 |
    eventlog

    Eventlog

    119 | 120 |

    Methods (by class)

    121 | 122 |
      123 |
    • eventlog: Group eventlog on resource identifier

    • 124 |
    125 | 126 | 127 |
    128 | 137 |
    138 | 139 |
    140 | 143 | 144 |
    145 |

    Site built with pkgdown.

    146 |
    147 | 148 |
    149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/reference/activity_labels.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Get vector of activity labels — activity_labels • bupaR 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | 88 | 89 | 90 |
    91 | 92 |
    93 |
    94 | 99 | 100 |
    101 | 102 |

    Retrieve a vector containing all unique activity labels

    103 | 104 |
    105 | 106 |
    activity_labels(eventlog)
    107 | 
    108 | # S3 method for eventlog
    109 | activity_labels(eventlog)
    110 | 111 |

    Arguments

    112 | 113 | 114 | 115 | 116 | 117 | 118 |
    eventlog

    Eventlog

    119 | 120 |

    Methods (by class)

    121 | 122 |
      123 |
    • eventlog: Retrieve activity labels from eventlog

    • 124 |
    125 | 126 | 127 |
    128 | 137 |
    138 | 139 | 149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | --------------------------------------------------------------------------------