1

Using the bupaR package I use the built in dataset patients to create this plot:

library(bupaR)

pat<-bupaR::simple_eventlog(eventlog = patients,
                            case_id = ".order",
                            activity_id = "handling_id",
                            #activity_instance_id = "activity_instance_id",
                            timestamp = "time",
                            #lifecycle_id = "lifecycle",
                            #resource_id = ""
)
pat %>%
     throughput_time("case") %>%
     plot()

When I try to do the same with this dataset:

po59<-structure(list(case_id = c("WC4120721", "WC4120667", "WC4120689", 
"WC4121068", "WC4120667", "WC4120666", "WC4120667", "WC4121068", 
"WC4120667", "WC4121068", "WC4121068", "WC4120666", "WC4120721", 
"WC4120666", "WC4120666"), lifecycle = c(110, 110, 110, 110, 
120, 110, 130, 120, 10, 130, 10, 120, 120, 130, 10), action = c("WC4120721-CN354877", 
"WC4120667-CN354878", "WC4120689-CN356752", "WC4121068-CN301950", 
"WC4120667-CSW310", "WC4120666-CN354878", "WC4120667-CSW308", 
"WC4121068-CSW303", "WC4120667-CSW309", "WC4121068-CSW308", "WC4121068-CSW309", 
"WC4120666-CSW310", "WC4120721-CSW310", "WC4120666-CSW308", "WC4120666-CSW309"
), activity = c("Forged Wire, Medium (Sport)", "Forged Wire, Medium (Sport)", 
"Forged Wire, Medium (Sport)", "Forged Wire, Medium (Sport)", 
"BBH-1&2", "Forged Wire, Medium (Sport)", "TCE Cleaning", "SOLO Oil", 
"Tempering", "TCE Cleaning", "Tempering", "BBH-1&2", "BBH-1&2", 
"TCE Cleaning", "Tempering"), resource = c("3419", "3216", "3409", 
"3201", "C3-100", "3216", "C3-080", "C3-030", "C3-090", "C3-080", 
"C3-090", "C3-100", "C3-100", "C3-080", "C3-090"), timestamp = structure(c(-62042010952, 
-62010323872, -61884118792, -61821087232, -61821025132, -61789534972, 
-61789520332, -61789494952, -61757940232, -61757925652, -61757895952, 
-61694827552, -61694808292, -61663337152, -61663307452), tzone = "Europe/Istanbul", class = c("POSIXct", 
"POSIXt")), .order = 1:15), row.names = c(NA, -15L), class = c("eventlog", 
"log", "tbl_df", "tbl", "data.frame"), case_id = "case_id", activity_id = "activity", activity_instance_id = "action", lifecycle_id = "lifecycle", resource_id = "resource", timestamp = "timestamp") 

po59 %>%
          throughput_time("case") %>%
          plot()

I get

Error in UseMethod("rescale") : 
  no applicable method for 'rescale' applied to an object of class "difftime"

The throughput_time() is here

firmo23
  • 7,490
  • 2
  • 38
  • 114

0 Answers0