Closed zyaar closed 4 years ago
The first problem is currently expected: direct grouping on mapping variables conflict with the computation of metric. If you want to do something for each activities, use the level = "activity" argument (should be noted that the throughput_time is not applicable at this level, it doesn't make much sense).
The second problem should be solved when you install edeaR from github, can you verify this? (The warnings still appear, but the error should be gone)
Thanks for the quick response... however, it does not seem to be working. I did the installation of edeaR from github but still getting the same errors. Should I install other (or all) packages off of github, because, at least for edeaR, it seemed to be the same version (0.8.3), here is what I ran:
install_github("bupaverse/edeaR")
In terms of the examples, apologies, I didn't give you very good examples (I'm working off of a completely different dataset which much more complexity and I'm essentially getting this 'corrupt grouped_df' issue using group_by that I didn't use to get with a dplyr pre 0.8.0), it's only happening when I do group_by. All the group_by's are on extended meta-data that is at the case_id level (so group_by some meta-data variable to see if the throughputs are different) OR when attempting to group by a timestamp (so see if the throughputs are changing month-by-month). All examples used to work before the update to dplyr that is giving errors now:
Here is an example, that I think demonstrates the problem that has continued (doesn't work at the "log" level where I think it should, but doesn't work at any of the other levels either):
test1 <- patients %>% group_by_case %>% mutate(start_month_of_case = month(time)) %>% ungroup_eventlog()
test1 %>% group_by(start_month_of_case) %>% throughput_time()
Error: `.data` is a corrupt grouped_df, the `"groups"` attribute must be a data frame
In addition: Warning messages:
1: `cols` is now required.
Please use `cols = c(raw)`
2: `cols` is now required.
Please use `cols = c(data)`
BTW... on a separate note, if you permit me a brief fanboy moment... big fan of the buparverse and the quality of the packages and the APIs here, your product is very impressive, kudos to your team!!
Apologies, I had seen this error before and couldn't replicate it with your example, assuming it was solved. I'll have a more thorough look as soon as possible. Could you share the result of traceback() for the error? Thx.
Ok, good to know if you can't replicate (might be a package problem). Here is my tracestack()
15: stop(list(message = "`.data` is a corrupt grouped_df, the `\"groups\"` attribute must be a data frame",
call = NULL, cppstack = NULL))
14: group_data_grouped_df(.data)
13: group_data.grouped_df(x)
12: group_data(x)
11: group_vars.grouped_df(x)
10: group_vars(x)
9: `[.grouped_df`(x, seq_len(n), , drop = FALSE)
8: x[seq_len(n), , drop = FALSE]
7: head.data.frame(x, n)
6: head(x, n)
5: as.data.frame(head(x, n))
4: tibble::trunc_mat(data)
3: print(tibble::trunc_mat(data))
2: print.throughput_time(x)
1: function (x, ...)
UseMethod("print")(x)
here is the sessioninfo() as well (in case it helps):
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lubridate_1.7.4 petrinetR_0.2.1 processmonitR_0.1.0 xesreadR_0.2.3 processmapR_0.3.3 eventdataR_0.2.0 edeaR_0.8.3 bupaR_0.4.2
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 lattice_0.20-38 tidyr_1.0.0 visNetwork_2.0.8 zoo_1.8-6 assertthat_0.2.1 zeallot_0.1.0 digest_0.6.22 mime_0.7
[10] R6_2.4.0 backports_1.1.5 httr_1.4.1 ggplot2_3.2.1 pillar_1.4.2 rlang_0.4.1 lazyeval_0.2.2 shinyTime_1.0.1 rstudioapi_0.10
[19] data.table_1.12.6 miniUI_0.1.1.1 DiagrammeR_1.0.1 downloader_0.4 readr_1.3.1 stringr_1.4.0 htmlwidgets_1.5.1 igraph_1.2.4.1 munsell_0.5.0
[28] shiny_1.4.0 compiler_3.5.1 influenceR_0.1.0 rgexf_0.15.3 httpuv_1.5.2 pkgconfig_2.0.3 htmltools_0.4.0 tidyselect_0.2.5 tibble_2.1.3
[37] gridExtra_2.3 XML_3.98-1.20 viridisLite_0.3.0 crayon_1.3.4 dplyr_0.8.3 later_1.0.0 grid_3.5.1 jsonlite_1.6 xtable_1.8-4
[46] gtable_0.3.0 lifecycle_0.1.0 magrittr_1.5 scales_1.0.0 stringi_1.4.3 viridis_0.5.1 promises_1.1.0 ggthemes_4.2.0 xml2_1.2.2
[55] brew_1.0-6 vctrs_0.2.0 RColorBrewer_1.1-2 tools_3.5.1 forcats_0.4.0 glue_1.3.1 purrr_0.3.3 hms_0.5.2 Rook_1.1-1
[64] fastmap_1.0.1 yaml_2.2.0 colorspace_1.4-1 plotly_4.9.0
I just pushed some changed to github and both the error and the warning about cols should be solved now. If not, please let me know.
Thanks for your patience
Yes, that fixed it. Thanks!
I'm setting a consistent problem with edeaR using dplyr 0.8.3 whenever I try to use edeaR with grouped_eventlogs I get the various errors (only with grouped though):
Here are two simple examples (taken from the console of Rstudio:
or
here is my sessionInfo if it helps: