{messydates} logo to better reflect the
package’s purpose and be more brand-consistent with manydata
packagespurrr and dplyr dependencies
(replaced with base R), leaving only stringi and
lubridate as importsanytime and clock in Suggests,
since the interoperability tests exercise them where installedmdate class
as_messydate() now parses an optional date-time
separator, hh, hh:mm, and
hh:mm:ss (with fractional seconds), am/pm times, the UTC
designator Z, and numeric offsets
(e.g. +02:00), zero-padding and normalising them2019-03-01 14:30:00) for readability (as permitted by
ISO 8601-1 sec. 4.3.2 and RFC 3339), but a T separator can
be used on input and is normalised to a space in the output: and _ continue to work as range
separators; times are detected and protected first, so
2009-01-01:2019-01-01 is a range while
2019-03-01 14:30:00 is a time~), uncertain (?), both (%), and
unspecified (X), e.g. 2019-03-01 ~14:30as_messydate("2:30pm") -> 14:30,
as_messydate("around 2pm") -> 14:00~); this
requires a clear time signal (a colon-clock or am/pm), so a bare
2019 is still a year, and a bare am/pm hour
(2pm) fills to 14:00. A leading “at”
("at 2:30pm", "at around 2pm") is recognised
and dropped.
hour()/minute()/second()/tz(),
precision(), expand(), and
approximate()/uncertain() all handle date-less
timesmessyduration() to
make_messyduration() for consistency with other
make_*() functions, and renamed resulting class from
messyduration to mduration"4th July 1976"): either day-first or
month-first order ("Fourth of July 1976",
"July 4th 1976"), “day of” phrasings, and “last day of
<month>” (leap-year aware for February)"between the 13th and 15th of Feb 1977" (or
"from the 13th to the 15th") becomes a range"the 13th or the 15th" a set"13th and 15th", or a comma-separated list of
dates, becomes several dates"February 2004" ->
2004-02)"the 1910s" -> 191X)"the 19th century" ->
18XX)"before 1910" -> ..1910
and "after 1910" -> 1910.., where the bound
may itself be imprecise ("before the 1920s" ->
..192X)"around", "circa", …)
add ~"possibly", "reportedly",
…) add ?%, applied to the most specific
component"MDCCLXXVI" becomes
1776)"the Ides of March, 44 BC" becomes
-0044-03-15 (Kalends, Nones, and Ides, with the later
Nones/Ides of March, May, July, and October)POSIXct/POSIXlt now
preserves the time of day (midnight is treated as date-only);
as.POSIXct()/as.POSIXlt() restore it{lubridate}: its
as_date() and as_datetime() coercion verbs now
work on an mdate, honouring the FUN resolver
(e.g. as_date(md, FUN = vmax)), as do format()
on mdate columns in data frames and tibblesas.POSIXct()/as.POSIXlt() erroring
on a vector of two or more mdates (the check for
pre-common-era dates was not vectorised)as_approximate()/as_uncertain() to
approximate()/uncertain() for consistency with
on_or_before()/on_or_after() (these aren’t
coercion functions); old names are defunct and warnapproximate()/uncertain() to
accept “hour”, “minute”, “second”, and “time” componentsapproximate()/uncertain() to
combine annotations as % when both are applied to the same
componentmedian()/vmedian() treat an even
number of dates, which no longer silently returns NA but
instead averages the two middle valuesmean()/vmean()/median()/vmedian()
average precise date-times, honouring the time of day, instead of
miscomputing via lubridate::as_date()+/-) and
seq() to accept sub-day units (“hours”, “minutes”,
“seconds”) and operate on times
messyduration() keeps sub-day precision"2012-02-03 14:30" + "1 year" is
2013-02-03 14:30 (with month-end rollback)"2012-01-01T09:00.." + "2 hours" or
"..2012-01-01T09:00" + "1 month") dropped ..
marker</>/<=/>=
compare time of day on the same calendar day, no longer silently
truncating both sides to a date first and treating them as equalDate/POSIXct objects in a session with
{messydates} loaded, including in unrelated packages:
</>/<=/>=
are registered for "Date"/"POSIXt" classes (so
that e.g. Date < mdate works), any comparison
of a zero-length or all-NA
Date/POSIXct/POSIXlt value was
passed through as_messydate(), where ifelse()
and paste0() silently changed type or length and tripped an
internal is.character() check. This broke loading packages
whose .onLoad hooks compare timestamps, such as
{httr2}’s cache pruning, which in turn broke
pkgdown::build_news()Sys.time() < (Sys.time() + Inf) – the pattern
{httr2} uses to represent an unbounded retry deadline –
incorrectly evaluated to FALSE, in turn breaking
httr2::req_perform() (and so any request made while
{messydates} is loaded, including pkgdown’s
GitHub release-timeline lookup)hour(), minute(),
second(), and tz() time component
extractorsmonth(), day(), and
precision() to be vectorised and no longer call
expand() more than necessaryprecision() to extend below the day: 24 to the
hour, 1440 to the minute, and 86400 to the second (date-level precision
is unchanged)year(), month(), day(),
hour(), minute(), second(), and
tz() are now S3 methods on the same-named
{lubridate} generics rather than plain functions, so the
two packages can be loaded together (in either order) without one
masking the other: these accessors dispatch to the messy-date logic on
an mdate but to {lubridate}’s own methods on a
Date/POSIXctexpand() error when approx_range was
set and the vector contained a reduced-precision value (e.g. a bare
year-month) alongside an approximate oneexpand() with a by argument
(default "day")
by to "hour",
"min", or "sec" for finer enumerationas_messydates() handles text with dates in
American format, e.g. October 10, 2010 (fixes #86)year() to be faster and work on durationsprecision()
precision() is now a S3 generic, dispatching to
precision.mdate()precision.mdate() now returns the inverse of the
previous measure, meaning maximising precision makes more sensemreport() to {manydata}as.POSIXct.mdate() and
as.POSIXlt.mdate()validate_messydate()as.numeric() to as.double() to fix
S3 dispatchingmin.mdate() and
max.mdate() for summaries and vmin.mdate() and
vmax.mdate() for vector coercionmean.mdate(),
median.mdate(), and modal.mdate() for
summaries and vmean.mdate(), vmedian.mdate(),
and vmodal.mdate() for vector coercionrandom.mdate() now in
vrandom.mdate()precision() calculates precision{tibble} dependency by just using
{dplyr}{stringr} to {stringi} for
speedas.numeric.mdate() and
as_messydate.numeric() for coercing between messydates and
numbers (closes #85)seq.mdate() for creating sequences from one or
two messydates
is_bce() for testing whether dates are from
before the common erastri_squish() helper for trimming white space
everywherec.mdate() so that it will strip class from an
mdate object, as expectedis_uncertain() and
is_approximate() so that they also recognise %
annotationsmin.mdate(), max.mdate(), and
modal.mdate() to avoid using expand() and
consequently run much fastermin.mdate(), max.mdate(),
modal.mdate(), mean.mdate(),
median.mdate(), and random.mdate() by adding
recursive argument for resolving vectors down to a
scalarmessyduration.mdate() where the minimum of
an underspecified later date was usedas_messydate() where zero padding for
early dates was not added correctlymdates_duration class that
introduces methods to annotate a duration or period with representations
of its uncertainty<, >,
<=, >=) (thanks @WerthPADOH)%l%
%le%, %g%, %ge%,
%><%, %>=<%)mdate() for
as_messydate()%intersect% and %union%)is_element() by is_subset() for
clarity and consistencymake_messydates() function to
also construct ranges of datescontract() function checks if ‘mdate’
object has been expandedas_messydate() function
contract() function to ‘expand’
dates before ‘contracting’ themexpand() function to handle, and properly
convert, date objects that are not ‘mdate’as_messydates() for explicit date format conversion, if
necessarybattles data by adding ‘parties’ variablemreport() function to properly
report on data containing ‘mdate’ variablesexpand() function
mdate
{skimr} template for
mdate classas_messydate() allowing users to choose component order of
ambiguous datesas_messydate() re-orders 6
digit date components if necessaryas_messydate() to also extract dates from text
stringsis_precise() function that provides a logical
test for precise datesexpand() to allow for the expansion of
incomplete date ranges and sets of dates{messydates}
packagemessydt objects
add() and subtract() helper
functions for arithmetic operationsexpand() function
expand() to manage negative
datesexpand_negative_dates() helper function for
expanding ranges of negative datesmessydt objects to
Date to manage negative dates
negative_dates() helper function to coerce
negative messydt datescompact_negative_dates() helper function to
compact negative date rangesis.sequence() as a helper function to check if
dates are a rangeinterleave()
function{messydates} from Github{messydates}
from Githubmake_messydate()on_or_before()on_or_after()as_approximate()as_uncertain() (includes discrimination between month
uncertainty and day and month uncertainty)as_messydate() by adding zero padding for
month, day or yearresequence() to work consistently with
messydate objectsexpand() function to expand imprecise,
unspecified, approximate, uncertain, and negative dates according to
approximate ranges and added testsprecision() to return the lengths of expanded
datesmedian() in resolve family of functions to work
with changes to expand()expand()contract()precision()coerce_from_messydate()messydt class in DESCRIPTION fileas_messydate() functionsexpand() function{messydates} package
DESCRIPTION fileR folderLICENSE fileNAMESPACE fileNEWS fileREADME files.github folder and filestests folder and filesmessydt class which follows the latest ISO
8601 (2019) standards
as_messydate() function to coerce from date
objects to messydate
as_messydate() standardises date order, separators and
ambiguityas.Date.messydt() for coercing to date classas.POSIXct.messydt() for coercing to POSIXct
classas.POSIXlt.messydt() for coercing to POSIXlt
classexpand() function for expanding ranged and
uncertain datesmin.messydt() to get minimum value from expanded
rangemax.messydt() to get maximum value from expanded
rangemedian.messydt() to get median value from
expanded rangemean.messydt() to get mean value from expanded
rangemodal.messydt() to get mode value from expanded
rangecontract() function for contracting expanded
datesyear() to extract year from datemonth() to extract month from dateday() to extract day from datemake_messydate() function to get messy dates from
multiple columnsmd_intersect() to find intersection of sets of
messy datesmd_union() to find union of sets of messy
datesmd_multiset() to join two sets of messy
datesis_messydate() to test for messydt classis_intersecting() to test if dates intersectis_element() to test for multiple elements in
datesis_similar() to test for similarities in
datesàs_messydate()
functioncontract() functionexpand() functionmake_messydate() function
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.