Skip to content

Commit

Permalink
fix warning on :=
Browse files Browse the repository at this point in the history
  • Loading branch information
lizihao-anu authored Aug 9, 2023
1 parent 04399a4 commit 1d0e1d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/aggregate_by_chi.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ aggregate_ch_episodes <- function(episode_file) {
data.table::setDT(episode_file)

# Perform grouping and aggregation
episode_file <- episode_file[, `:=`(
ch_no_cost = max(ch_no_cost),
ch_ep_start = min(record_keydate1),
ch_ep_end = max(ch_ep_end),
ch_cost_per_day = mean(ch_cost_per_day)
episode_file[, c(
ch_no_cost := max(ch_no_cost),
ch_ep_start := min(record_keydate1),
ch_ep_end := max(ch_ep_end),
ch_cost_per_day := mean(ch_cost_per_day)
), by = c("chi", "ch_chi_cis")]

# Convert back to tibble if needed
Expand Down

0 comments on commit 1d0e1d9

Please sign in to comment.