Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edeaR filter_infrequent_flows is not robust against event logs with label column and integer activity_instance column #51

Open
fmannhardt opened this issue Nov 14, 2023 · 0 comments

Comments

@fmannhardt
Copy link
Member

I don't have the time to make a repex but want to post this so I don't forget.
Debugged down the issue with the function to be a column named label.

I think it goes wrong here (which is actually in base bupaR):

add_start_activity <- function(log, label = "Start") {    
    log %>%
      group_by_case() %>%
      arrange(.data[[timestamp(log)]]) %>%
      slice_events(1) %>%
      ungroup_eventlog() %>%
      mutate(!!timestamp(log) := .data[[timestamp(log)]] - 1,
             !!activity_id(log) := factor(label, levels = c(as.character(bupaR::activity_labels(log)), label)),
             !!activity_instance_id(log) := stri_c(.data[[case_id(log)]], "start", sep = "-")) -> start_states
    
    return(add_start_end_activity_bind_logs(log, start_states, label))
  }  

It seems dplyr somehow evaluates some of the label variables to the column and not the parameter.
The other issue is the stri_c command to define the activity instance clashes if the instance is an int column.

Probably this should be moved to bupaR but this is how I got to the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant