DavisVaughan / warp
Showing 4 of 11 files from the diff.

@@ -114,6 +114,10 @@
Loading
114 114
#'   This is generally used to define the anchor time to count from, which is
115 115
#'   relevant when the every value is `> 1`.
116 116
#'
117 +
#' @param ... `[dots]`
118 +
#'
119 +
#'   These dots are for future extensions and must be empty.
120 +
#'
117 121
#' @return
118 122
#' A double vector containing the distances.
119 123
#'
@@ -204,6 +208,11 @@
Loading
204 208
#'   mweek = warp_distance(x, "mweek")
205 209
#' )
206 210
#'
207 -
warp_distance <- function(x, period, every = 1L, origin = NULL) {
211 +
warp_distance <- function(x,
212 +
                          period,
213 +
                          ...,
214 +
                          every = 1L,
215 +
                          origin = NULL) {
216 +
  check_dots_empty("warp_distance", ...)
208 217
  .Call(warp_warp_distance, x, period, every, origin)
209 218
}

@@ -38,6 +38,11 @@
Loading
38 38
#' # [1969-12-28, 1970-01-02)
39 39
#' # [1970-01-02, 1970-01-07)
40 40
#' warp_boundary(x, "day", every = 5, origin = origin)
41 -
warp_boundary <- function(x, period, every = 1L, origin = NULL) {
41 +
warp_boundary <- function(x,
42 +
                          period,
43 +
                          ...,
44 +
                          every = 1L,
45 +
                          origin = NULL) {
46 +
  check_dots_empty("warp_boundary", ...)
42 47
  .Call(warp_warp_boundary, x, period, every, origin)
43 48
}

@@ -52,9 +52,11 @@
Loading
52 52
#' warp_change(x, period = "yday", every = 2, last = FALSE, endpoint = TRUE)
53 53
warp_change <- function(x,
54 54
                        period,
55 +
                        ...,
55 56
                        every = 1L,
56 57
                        origin = NULL,
57 58
                        last = TRUE,
58 59
                        endpoint = FALSE) {
60 +
  check_dots_empty("warp_change", ...)
59 61
  .Call(warp_warp_change, x, period, every, origin, last, endpoint)
60 62
}

@@ -0,0 +1,20 @@
Loading
1 +
dots_n <- function(...) {
2 +
  nargs()
3 +
}
4 +
5 +
# Like `ellipsis::check_dots_empty()` but without the import
6 +
check_dots_empty <- function(fn, ...) {
7 +
  n <- dots_n(...)
8 +
9 +
  if (n == 0L) {
10 +
    return(invisible())
11 +
  }
12 +
13 +
  msg <- paste0(
14 +
    "`...` is not empty in `", fn, "()`.\n",
15 +
    "These dots only exist to allow for future extensions and should be empty.\n",
16 +
    "Did you misspecify an argument?"
17 +
  )
18 +
19 +
  stop(msg, call. = FALSE)
20 +
}
Files Coverage
R 76.19%
src 94.71%
Project Totals (17 files) 94.30%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading