I'm new to R, so would like some help please.
I have some code for a PoC that produces and output shown in "Scenario 3" here at https://bupar.net/creating_eventlogs.html , but how would I save the results to a file from this code please?
Code is below
data %>%
# recode lifecycle variable appropriately
dplyr::mutate(registration_type = forcats::fct_recode(registration_type,
"start" = "started",
"complete" = "completed")) %>%
convert_timestamps(columns = "time", format = ymd_hms) %>%
eventlog(case_id = "patient",
activity_id = "handling",
activity_instance_id = "handling_id",
lifecycle_id = "registration_type",
timestamp = "time",
resource_id = "employee")
You get an out put
## # Log of 12 events consisting of:
## 1 trace
## 1 case
## 6 instances of 6 activities
## 6 resources
## Events occurred from 2017-07-03 05:21:36 until 2017-07-09 19:29:29
##
## # Variables were mapped as follows:
## Case identifier: patient
## Activity identifier: handling
## Resource identifier: employee
## Activity instance identifier: handling_id
## Timestamp: time
## Lifecycle transition: registration_type
##
## # A tibble: 12 x 7
## patient handling employee handling_id registration_ty~ time
## <chr> <fct> <fct> <chr> <fct> <dttm>
## 1 187 Registrati~ r1 187 start 2017-07-03 05:21:36
## 2 187 Triage and~ r6 687 start 2017-07-03 08:57:23
## 3 187 Registrati~ r3 187 complete 2017-07-03 08:57:23
## 4 187 Triage and~ r4 687 complete 2017-07-03 16:49:13
## 5 187 Blood test r2 1091 start 2017-07-08 13:30:11
## 6 187 Blood test r2 1091 complete 2017-07-08 19:25:15
## 7 187 MRI SCAN r7 1328 start 2017-07-09 00:55:50
## 8 187 MRI SCAN r1 1328 complete 2017-07-09 04:54:05
## 9 187 Discuss Re~ r3 1921 start 2017-07-09 09:57:59
## 10 187 Discuss Re~ r7 1921 complete 2017-07-09 12:17:58
## 11 187 Check-out r4 2416 start 2017-07-09 16:27:02
## 12 187 Check-out r6 2416 complete 2017-07-09 19:29:29
## # ... with 1 more variable: .order <int>
```
I've been following "Scenario 3" here at https://bupar.net/creating_eventlogs.html
I can generate the output shown on the page above, my question is how do I actually get the data out to disk or work with it in memory please?