Skip to content

Commit

Permalink
bupaR 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gertjanssenswillen committed Mar 31, 2023
1 parent 1666dff commit b80808e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Package: bupaR
Type: Package
Title: Business Process Analysis in R
Version: 0.5.2.9000
Date: 2022-09-30
Version: 0.5.3
Authors@R: c(person("Gert","Janssenswillen", email = "[email protected]", role = c("aut","cre")),
person("Gerard","van Hulzen",email = "[email protected]", role = c("ctb")),
person("Felix","Mannhardt",email = "[email protected]", role = c("ctb")),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ S3method(print,activitylog_mapping)
S3method(print,eventlog_mapping)
S3method(print,grouped_log)
S3method(print,log)
S3method(rename,grouped_log)
S3method(rename,log)
S3method(resource_id,activitylog)
S3method(resource_id,activitylog_mapping)
Expand Down
22 changes: 21 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# bupaR 0.5.1 (dev)
# bupaR 0.5.3

## Features

* Added new `rename` method, similar to dplyr's rename, that automatically changes the mapping of the log if the rename concerns any mapping variables.
* Added new `count` method, to increase compatibility with dplyr. `count` will automatically convert the `log` object to a `tibble`.

## Bug Fixes

* `group_by(.data, ..., .add = F)` now works correctly on `grouped_eventlog`. Previously, applying `group_by()` to a `grouped_eventlog`
reverted it to a `data.frame`, which prevented the application of further **bupaR** functions on the returned value.
* The `"raw"` attribute of metrics in **edeaR** (e.g. `throughput_time`) containing the original data is now kept after
applying `group_by()`. This can be useful for further analyses on the output of metrics and can be accessed using `attr(log, "raw")`.
* Fixed bug in `add_start_activity()` and `add_end_activity()` which failed when applied to an `activitylog`.
* Fixed bug in `activitylog`. Failed when not both start and complete columns where available.
* Fixed bug in `assign_instance_id`. Failed when data had a column with the name `status`.

## Other


# bupaR 0.5.1

## Features

Expand Down
18 changes: 18 additions & 0 deletions R/rename.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,21 @@ rename.log <- function(.data, ...) {
rename(...) %>%
re_map(mapping)
}

#' @describeIn rename Rename grouped log
#' @export

rename.grouped_log <- function(.data, ...) {

groups <- groups(.data)

renames <- list(...)
mapping <- mapping(.data)
mapping[mapping %in% renames] <- names(renames)

.data %>%
as_tibble() %>%
rename(...) %>%
re_map(mapping) %>%
group_by(pick(as.character(groups)))
}

0 comments on commit b80808e

Please sign in to comment.