Skip to content

Commit 0acaaa0

Browse files
authored
Merge pull request #89 from globalgov/develop
v0.5.2
2 parents b6eebe9 + 7f28078 commit 0acaaa0

56 files changed

Lines changed: 1253 additions & 1171 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
^CRAN-SUBMISSION$
1515
^article$
1616
^.DS_Store$
17+
^next$

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ article/jsslogo.jpg
1515
article/references.bib
1616
article/article_files
1717
vignettes-old
18+
next
1819

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Description: Contains a set of tools for constructing and coercing
99
date ranges, and sets of dates.
1010
This is useful for describing and analysing temporal information,
1111
whether historical or recent, where date precision may vary.
12-
Version: 0.5.1
13-
Date: 2025-02-25
12+
Version: 0.5.2
13+
Date: 2025-03-07
1414
Authors@R:
1515
c(person(given = "James",
1616
family = "Hollway",

NAMESPACE

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ S3method(as.Date,mdate)
2222
S3method(as.POSIXct,mdate)
2323
S3method(as.POSIXlt,mdate)
2424
S3method(as.data.frame,mdate)
25+
S3method(as.double,mdate)
2526
S3method(as.list,mdate)
26-
S3method(as.numeric,mdate)
2727
S3method(as_messydate,Date)
2828
S3method(as_messydate,POSIXct)
2929
S3method(as_messydate,POSIXlt)
@@ -39,13 +39,18 @@ S3method(messyduration,character)
3939
S3method(messyduration,mdate)
4040
S3method(min,mdate)
4141
S3method(modal,mdate)
42-
S3method(mreport,default)
4342
S3method(print,mdate)
4443
S3method(print,mdates_duration)
45-
S3method(print,mreport)
44+
S3method(random,character)
4645
S3method(random,mdate)
4746
S3method(rep,mdate)
4847
S3method(seq,mdate)
48+
S3method(vmax,mdate)
49+
S3method(vmean,mdate)
50+
S3method(vmedian,mdate)
51+
S3method(vmin,mdate)
52+
S3method(vmodal,mdate)
53+
S3method(vrandom,mdate)
4954
export("%><%")
5055
export("%>=<%")
5156
export("%g%")
@@ -77,7 +82,6 @@ export(mdate)
7782
export(messyduration)
7883
export(modal)
7984
export(month)
80-
export(mreport)
8185
export(new_messydate)
8286
export(new_messyduration)
8387
export(on_or_after)
@@ -86,8 +90,13 @@ export(precision)
8690
export(random)
8791
export(validate_messydate)
8892
export(validate_messyduration)
93+
export(vmax)
94+
export(vmean)
95+
export(vmedian)
96+
export(vmin)
97+
export(vmodal)
98+
export(vrandom)
8999
export(year)
90-
importFrom(dplyr,"%>%")
91100
importFrom(dplyr,first)
92101
importFrom(dplyr,last)
93102
importFrom(dplyr,lead)
@@ -99,7 +108,6 @@ importFrom(lubridate,ymd)
99108
importFrom(purrr,map)
100109
importFrom(purrr,pmap_chr)
101110
importFrom(stats,median)
102-
importFrom(stats,na.omit)
103111
importFrom(stringi,stri_detect_regex)
104112
importFrom(stringi,stri_extract_all_regex)
105113
importFrom(stringi,stri_replace_all_fixed)

NEWS.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# messydates 0.5.2
2+
3+
## Package
4+
5+
- Moved `mreport()` to `{manydata}`
6+
- Consolidated and renamed scripts internally
7+
8+
## Coerce to
9+
10+
- Fixed pkgdown#2855 by fixing how as_messydate methods interpret infinite dates
11+
- Fixed time zone defaults in `as.POSIXct.mdate()` and `as.POSIXlt.mdate()`
12+
- Fixed set bug in `validate_messydate()`
13+
14+
## Coerce from
15+
16+
- Renamed `as.numeric()` to `as.double()` to fix S3 dispatching
17+
- Separated extrema functions into `min.mdate()` and `max.mdate()` for summaries
18+
and `vmin.mdate()` and `vmax.mdate()` for vector coercion
19+
- Separated tendency functions into `mean.mdate()`, `median.mdate()`, and `modal.mdate()` for summaries
20+
and `vmean.mdate()`, `vmedian.mdate()`, and `vmodal.mdate()` for vector coercion
21+
- Vector coercion previously in `random.mdate()` now in `vrandom.mdate()`
22+
- Improved how coercion/resolution functions handle BCE dates
23+
24+
## Manipulation
25+
26+
- Fixed how `precision()` calculates precision
27+
128
# messydates 0.5.1
229

330
## Package

R/class.R

Lines changed: 0 additions & 213 deletions
This file was deleted.

R/duration.R renamed to R/class_duration.R

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,23 @@
1212
#' @param approx_range Range to expand approximate dates, in days.
1313
#' If 3, for example, adds 3 days; if -3, removes 3 days from both sides.
1414
#' @return Object of class `description`
15-
#' @name duration_class
15+
#' @name class_duration
1616
#' @examples
1717
#' messyduration(as_messydate(c("2010-01-01..2010-12-31", "2010-01..2010-12")))
1818
NULL
1919

20-
#' @rdname duration_class
20+
#' @rdname class_duration
2121
#' @export
2222
new_messyduration <- function(x = character()) {
2323
stopifnot(is.character(x))
2424
structure(x, class = "mdates_duration")
2525
}
2626

27-
#' @importFrom utils str
28-
#' @export
29-
print.mdates_duration <- function(x, ...) {
30-
str(x)
31-
}
32-
33-
#' @rdname duration_class
27+
#' @rdname class_duration
3428
#' @export
3529
messyduration <- function(x, approx_range = 0) UseMethod("messyduration")
3630

37-
#' @rdname duration_class
31+
#' @rdname class_duration
3832
#' @export
3933
validate_messyduration <- function(x, approx_range = 0) {
4034
if (any(!grepl("\\.\\.", x))) {
@@ -43,7 +37,7 @@ validate_messyduration <- function(x, approx_range = 0) {
4337
}
4438
}
4539

46-
#' @rdname duration_class
40+
#' @rdname class_duration
4741
#' @export
4842
messyduration.character <- function(x, approx_range = 0) {
4943
message("Converting to mdate class.")
@@ -53,7 +47,7 @@ messyduration.character <- function(x, approx_range = 0) {
5347
new_messyduration(x)
5448
}
5549

56-
#' @rdname duration_class
50+
#' @rdname class_duration
5751
#' @export
5852
messyduration.mdate <- function(x, approx_range = 0) {
5953
validate_messyduration(x)

0 commit comments

Comments
 (0)