Skip to content

Commit

Permalink
Move 'get.bin.dates.from.ranges' into 'util-misc'
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
  • Loading branch information
MaLoefUDS committed Feb 14, 2024
1 parent a1842e9 commit 858b181
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 11 additions & 0 deletions util-misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -1011,3 +1011,14 @@ get.data.from.range = function(range, data) {
return(data.between)
}
}

#' Obtain the start and end dates from given ranges.
#'
#' @param ranges the ranges to get the dates from
#'
#' @return a sorted vector of all the start the end dates of the given ranges
get.bin.dates.from.ranges = function(ranges) {
dates = sort(unname(unique(get.date.from.unix.timestamp(unlist(ranges)))))
return(dates)
}

10 changes: 0 additions & 10 deletions util-split.R
Original file line number Diff line number Diff line change
Expand Up @@ -1084,16 +1084,6 @@ split.data.by.time.or.bins = function(project.data, splitting.length, bins, spli
return(cf.data)
}

#' Obtain the start and end dates from given ranges.
#'
#' @param ranges the ranges to get the dates from
#'
#' @return a sorted vector of all the start the end dates of the given ranges
get.bin.dates.from.ranges = function(ranges) {
dates = sort(unname(unique(get.date.from.unix.timestamp(unlist(ranges)))))
return(dates)
}


## / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
## Unification of range names ----------------------------------------------
Expand Down

0 comments on commit 858b181

Please sign in to comment.