Skip to content

Commit

Permalink
Add range information to splits in 'split.network.time.based.by.ranges'
Browse files Browse the repository at this point in the history
This change makes splitting by ranges more consistent with time-based
splitting.

This works towards se-sic#273.

Signed-off-by: Maximilian Löffler <[email protected]>
  • Loading branch information
maxloeffler committed Dec 10, 2024
1 parent 4b0d522 commit 87911ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util-split.R
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,11 @@ split.network.time.based.by.ranges = function(network, ranges, remove.isolates =
}
)

# add range information
if (is.null(names(nets.split))) {
names(nets.split) = ranges
}

## convert ranges to bins
bins = get.bin.dates.from.ranges(ranges.bounds)
attr(nets.split, "bins") = bins
Expand Down

0 comments on commit 87911ad

Please sign in to comment.