add_token_size: Adds a token size attribute

Description Usage Arguments Examples

View source: R/add_token_size.R

Description

Adds a size attribute to an event log that can be used in combination with the token_size parameter of animate_process

Usage

1
2
3
add_token_size(eventlog, attribute, size_attribute, min.size = 2,
  max.size = 8, na.size = 2, size_mapping = size_numeric(eventlog
  %>% pull(`!!`(attr)), min.size, max.size, na.size))

Arguments

eventlog

The source eventlog

attribute

The source attribute to calculate the size on

size_attribute

The target attribute to store the size information in

min.size

The minimum size

max.size

The maximum size

na.size

The size for NA values

size_mapping

A function that takes the attribute and returns a size between min.size and max.size, the default is a linear transformation that only works for numeric attributes..

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  # Load example event log
  library(eventdataR)

  # Generate random numeric attribute
  patients$test <- rnorm(nrow(patients), 5)

  # Add token size based on a numeric attribute
  add_token_size(patients, "test", "size")

}

processanimateR documentation built on Nov. 3, 2018, 1:03 a.m.