Skip to content

Commit 0920406

Browse files
committed
added more exports
1 parent 8d8a8ce commit 0920406

File tree

14 files changed

+77
-29
lines changed

14 files changed

+77
-29
lines changed

CRAN-SUBMISSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 2.1.4
2-
Date: 2022-10-17 06:23:27 UTC
3-
SHA: c1ae972993a3ff1254e684f05ff434a92b55110f
1+
Version: 2.1.5
2+
Date: 2024-11-19 13:34:15 UTC
3+
SHA: 8d8a8ce4444e1480d48c178c6838d18075ad3d5c

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ VignetteBuilder:
3232
Encoding: UTF-8
3333
LazyData: true
3434
Roxygen: list(markdown = TRUE)
35-
RoxygenNote: 7.0.2.9000
35+
RoxygenNote: 7.0.2
3636
Collate:
3737
'accessors.R'
3838
'arithmetic.R'

NAMESPACE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ S3method(as_date_yw,default)
5252
S3method(as_date_yw,numeric)
5353
S3method(as_date_yw,yearweek)
5454
S3method(as_yearmon,date_ym)
55+
S3method(as_yearmon,yearmon)
5556
S3method(as_yearqtr,date_yq)
57+
S3method(as_yearqtr,yearqtr)
5658
S3method(as_yearweek,date_yw)
5759
S3method(as_yearweek,yearweek)
5860
S3method(c,date_xx)
@@ -89,6 +91,10 @@ S3method(get_year,date_ym)
8991
S3method(get_year,date_yq)
9092
S3method(get_year,date_yw)
9193
S3method(get_year,default)
94+
S3method(increment,date_y)
95+
S3method(increment,date_ym)
96+
S3method(increment,date_yq)
97+
S3method(increment,date_yw)
9298
S3method(last_of_isoweek,default)
9399
S3method(last_of_isoyear,date_yw)
94100
S3method(last_of_isoyear,default)
@@ -101,6 +107,10 @@ S3method(last_of_year,default)
101107
S3method(last_of_year,integer)
102108
S3method(last_of_year,numeric)
103109
S3method(print,date_xx)
110+
S3method(range,date_y)
111+
S3method(range,date_ym)
112+
S3method(range,date_yq)
113+
S3method(range,date_yw)
104114
S3method(rep,date_xx)
105115
S3method(round,date_ym)
106116
S3method(round,date_yq)
@@ -159,6 +169,7 @@ export(get_isoyear)
159169
export(get_month)
160170
export(get_quarter)
161171
export(get_year)
172+
export(increment)
162173
export(is_Date)
163174
export(is_POSIXlt)
164175
export(is_date_xx)

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# dint 2.1.5
22

33
* Minor fixes to tests due to changes in R-base
4+
* Export `increment()` utility function
45

56

67
# dint 2.1.4

R/arithmetic.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,28 +146,31 @@ NULL
146146
# range -------------------------------------------------------------------
147147

148148

149-
149+
#' @export
150150
range.date_yq <- function(..., na.rm = FALSE) {
151151
as_date_yq(range(as.integer(c(...), na.rm = na.rm)))
152152
}
153153

154154

155155

156156

157+
#' @export
157158
range.date_ym <- function(..., na.rm = FALSE) {
158159
as_date_ym(range(as.integer(c(...), na.rm = na.rm)))
159160
}
160161

161162

162163

163164

165+
#' @export
164166
range.date_yw <- function(..., na.rm = FALSE) {
165167
as_date_yw(range(as.integer(c(...), na.rm = na.rm)))
166168
}
167169

168170

169171

170172

173+
#' @export
171174
range.date_y <- function(..., na.rm = FALSE) {
172175
as_date_y(range(as.integer(c(...), na.rm = na.rm)))
173176
}

R/format.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ format_ym <- function(x, m = NULL, format = "%Y-M%m"){
323323
#' format_yw(2015, 5)
324324
#' format_yw(201505, format = "%Y.%V")
325325
#' format_yw(as_date_yw(201505), format = "%y.%V")
326-
#'
327326
format_yw <- function(
328327
x,
329328
w = NULL,

R/increment.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#' @param x object to increment
44
#' @param inc Value by which to increment (usually integer)
55
#'
6+
#' @export
67
#' @return
78
#' An object of the same type as `x` increment by `inc`
8-
#' @noRd
99
increment <- function(x, inc = 1){
1010
assert(
1111
is_scalar(inc) ||
@@ -20,7 +20,8 @@ increment <- function(x, inc = 1){
2020

2121

2222

23-
23+
#' @rdname increment
24+
#' @export
2425
increment.date_yq <- function(x, inc){
2526
if (is_scalar(x) && length(inc) > 1){
2627
x <- rep(x, length(inc))
@@ -46,6 +47,8 @@ increment.date_yq <- function(x, inc){
4647

4748

4849

50+
#' @rdname increment
51+
#' @export
4952
increment.date_ym <- function(x, inc){
5053
if (is_scalar(x) && length(inc) > 1){
5154
x <- rep(x, length(inc))
@@ -71,6 +74,8 @@ increment.date_ym <- function(x, inc){
7174

7275

7376

77+
#' @rdname increment
78+
#' @export
7479
increment.date_yw <- function(x, inc){
7580
if (is_scalar(x) && length(inc) > 1){
7681
x <- rep(x, length(inc))
@@ -83,6 +88,8 @@ increment.date_yw <- function(x, inc){
8388

8489

8590

91+
#' @rdname increment
92+
#' @export
8693
increment.date_y <- function(x, inc){
8794
if (is_scalar(x) && length(inc) > 1){
8895
x <- rep(x, length(inc))

R/zoo-compat.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ as_yearqtr.date_yq <- function(x){
4848

4949

5050
#' @rdname as_yearqtr
51+
#' @export
5152
as_yearqtr.yearqtr <- function(x){
5253
x
5354
}
@@ -91,7 +92,7 @@ as_yearmon.date_ym <- function(x){
9192

9293

9394

94-
95+
#' @export
9596
#' @rdname as_yearqtr
9697
as_yearmon.yearmon <- function(x){
9798
x
@@ -152,12 +153,11 @@ as_yearweek.yearweek <- function(x){
152153

153154
#' For Compatibility With zoo
154155
#'
155-
#' Internaly used constructor. If you use zoo, please use [zoo::yearweek()]
156+
#' Internaly used constructor. If you use zoo, please use `zoo::yearweek()`
156157
#' instead
157158
#'
158159
#' @param x a vector with dates in the form 2000.0 for Q1, 2000.25 for Q2, usw
159160
#' @noRd
160-
#'
161161
yearweek <- function(x){
162162
x <- as.numeric(x)
163163
assert(

man/as.Date.date_xx.Rd

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dint-package.Rd

Lines changed: 2 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)