-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathextendr-wrappers.R
67 lines (50 loc) · 1.69 KB
/
extendr-wrappers.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Generated by extendr: Do not edit by hand
# nolint start
#
# This file was created with the following call:
# .Call("wrap__make_ymd_wrappers", use_symbols = TRUE, package_name = "ymd")
#' @usage NULL
#' @useDynLib ymd, .registration = TRUE
NULL
rust_ymd <- function(x) .Call(wrap__rust_ymd, x)
period_begin <- function(x, unit) .Call(wrap__period_begin, x, unit)
period_end <- function(x, unit) .Call(wrap__period_end, x, unit)
#' Calculate the date before / after months
#' @param ref_date a Date vector
#' @param months the number of months that's added to `ref_date`
#' @note The function name is the same as the Excel function `EDATE()` and
#' does the same. It returns the date that is the indicated number of months
#' before or after the ref date.
#' @examples
#' edate(as.Date("2020-01-31"), 1)
#' ## supports 'YMD' formatted integer or string
#' edate(200131, 1)
#' edate(200229, -12)
#'
#' @export
edate <- function(ref_date, months) .Call(wrap__edate, ref_date, months)
#' @rdname date_part
#' @export
year <- function(ref_date) .Call(wrap__year, ref_date)
#' @rdname date_part
#' @export
month <- function(ref_date) .Call(wrap__month, ref_date)
#' @rdname date_part
#' @export
quarter <- function(ref_date) .Call(wrap__quarter, ref_date)
#' @rdname date_part
#' @export
isoweek <- function(ref_date) .Call(wrap__isoweek, ref_date)
#' @rdname date_part
#' @export
isowday <- function(ref_date) .Call(wrap__isowday, ref_date)
#' @rdname date_part
#' @export
wday <- function(ref_date) .Call(wrap__wday, ref_date)
#' @rdname date_part
#' @export
mday <- function(ref_date) .Call(wrap__mday, ref_date)
#' @rdname date_part
#' @export
yday <- function(ref_date) .Call(wrap__yday, ref_date)
# nolint end