Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cumulative ranges #96

Merged
merged 26 commits into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cccdf84
Move range construction to misc module
clhunsen Feb 19, 2018
da8f851
Add possibility to get raw ranges
clhunsen Feb 19, 2018
9dd91f7
Update 'construct.ranges' to work more reliably on midnight datetimes
clhunsen Feb 19, 2018
8b14cc3
Implement function to construct overlapping ranges
clhunsen Feb 19, 2018
fc11886
Implement function to construct cumulative ranges
clhunsen Feb 20, 2018
f08d671
Implement function to aggregate ranges
clhunsen Feb 20, 2018
d96ed2f
Refactor 'split.data.by.networks'
clhunsen Feb 20, 2018
d9bcb80
Implement function to construct consecutive ranges
clhunsen Feb 21, 2018
7223a4f
Add utility function to generate date sequences
clhunsen Feb 21, 2018
335c2b5
Refactor 'construct.overlapping.ranges' to use 'generate.date.sequence'
clhunsen Feb 21, 2018
cbc1f3c
Fix range construction to properly include end date
clhunsen Feb 21, 2018
d421807
Refactor 'split.get.bins.time.based' to use 'generate.date.sequence'
clhunsen Feb 21, 2018
889af54
Add functions to split data and networks by ranges
clhunsen Feb 21, 2018
73da31b
Use 'split.data.time.based.by.ranges' in 'split.data.by.networks'
clhunsen Feb 21, 2018
23117c6
Tidy 'tests/test-split.R'
clhunsen Feb 21, 2018
843f8c7
Update splitting tests
clhunsen Feb 21, 2018
99e368b
Fix bug with end date when constructing overlapping ranges
clhunsen Feb 21, 2018
0ec4690
Check overlap for overlapping ranges
clhunsen Feb 21, 2018
db0cb14
Add test for consecutive and overlapping ranges
clhunsen Feb 21, 2018
41e8d56
Fix bug with project end when aggregating ranges
clhunsen Feb 21, 2018
87829a7
Add tests for cumulative and aggregated ranges
clhunsen Feb 21, 2018
dee0abb
Fix test for 'split.data.by.networks'
clhunsen Feb 22, 2018
afc96f4
Document exclicit bins in functions 'split.*.time.based' more precisely
clhunsen Feb 22, 2018
d97c889
Fix 'generate.date.sequence' to handle strings correctly
clhunsen Feb 22, 2018
28b4122
Add tests for date handling
clhunsen Feb 22, 2018
22124ee
Minor fixes from review in PR #96
clhunsen Feb 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions util-conf.R
Original file line number Diff line number Diff line change
Expand Up @@ -759,32 +759,6 @@ NetworkConf = R6::R6Class("NetworkConf", inherit = Conf,
## / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
## Helper functions --------------------------------------------------------

#' Construct the range strings.
#'
#' @param revs the revisions
#' @param sliding.window whether sliding window splitting is enabled or not
#' default: 'FALSE'
#'
#' @return the ranges as strings
construct.ranges = function(revs, sliding.window = FALSE) {
## setting offset to construct ranges, i.e.,
## combine each $offset revisions
offset = 1

## with sliding window, we combine each second revision
if (sliding.window)
offset = 2

## extract sequences of revisions
seq1 = revs[ 1:(length(revs) - offset) ]
seq2 = revs[ (offset + 1):length(revs) ]

## construct ranges
ranges = paste(seq1, seq2, sep = "-")

return(ranges)
}

#' Constructs a string representing a configuration (i.e., a potentially nested list).
#'
#' @param conf the configuration list to represent as string
Expand Down
Loading