knitr::opts_chunk$set(echo = TRUE, message = F, warning = F)

# Package imports:
library(magrittr)
library(dplyr)
library(rbig)

rprom: Process Modelling with R

rprom is a R package for modelling any type of process model from event-based time-series dataset. This package contains useful tools which provide functionalities for several types of process modelling. Some of these functionalities help you to:

Installation:

The package is currently available in Github only. You can install rprom directly from github:

devtools::install_github("https://github.com/genpack/rprom.git")

Package rutils is also required for rprom as a dependency. This package is also available in github:

devtools::install_github("https://github.com/genpack/rutils.git")

Getting Started:

The documentation of this package is yet under construction. We are constantly working to prepare the full documentation, however, here we show you how to build a simple model and generate some insights and visualisations:

library(rutils)
library(rprom)

tsobj = new('TRANSYS')
class(tsobj)

Now, you have built an object of type TRANSYS which is a Transition System. To feed your Transition System with some data, you need a dataset in the event-log format. You can get one from package eventdataR:

install.packages('eventdataR')
library(eventdataR)

patients_df = patients %>% as.data.frame()

patients_df %>% head %>% knitr::kable()

A Transition System is used to model entities(cases) which can take various stasuses at different times but can only be in one status at a time. Depending on our definition of statuses, we can make changes to an eventlog so that our custom define status column is built. These changes can include filtering some rows or modifying or combining one or multiple columns. In this example, we simply define completion of a task as a status, so we remove all rows where registration_type is not complete.

Now feed the object with the eventlog you have and for this, you need to specify the critical column headers:

tsobj$feed.eventlog(patients_df %>% filter(registration_type == 'complete'), 
                    caseID_col = 'patient', 
                    status_col = 'handling',
                    startTime_col = 'time')

Now you have built your Transition System object and fed it with data.

Adjacency matrix for a random walk analysis:

tsobj$get.adjacency(measure = 'rate')

If everything has successfully run up to here, you are ready to continue with more complex analysis.



genpack/promer documentation built on Jan. 26, 2025, 11:30 p.m.