The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
.github/CONTRIBUTING.md so that human contributors and
coding agents read the same notesDESCRIPTION version is bumped, that the PR title
names the new version, and that the PR description itemizes changes
under subsection titles; these items are consequently dropped from the
pull request templateConfig/Needs/check packages instead of
Config/Needs/websitevalidate_messydate() to report which elements
failed and what they contained, instead of naming only the rule that was
broken
mdate with
[<- or [[<- now reports what could not
be parsed, rather than silently blanking the elementunique() and duplicated() methods
for mdate objects (closes #106)
unique() fell through to the character
method and dropped the class, so a deduplicated column silently stopped
being an mdate"2012-01" and "2012-01-01..2012-01-31"
remain distinctas_messydate() to validate its input rather
than carrying values it cannot interpret:
"2019-02-30", "2019-06-31" and
"2019-01-01 25:00" now error instead of being accepted as
written; relatedly, "2019-13-45" is no longer silently
reordered into "2019-45-13", since month and day are only
swapped where the swap yields a date that could exist{messydates} does not
represent (week dates, ordinal dates, season codes, significant digits,
extended years, the P-style duration notation, and
repeating intervals) now error naming the format, instead of passing
through as strings that nothing downstream could expand, resolve or
compare. Durations themselves are unaffected: they are written as date
ranges and handled by mduration, and the error for
"P1Y2M" points thereNA, but now
warns, listing what could not be readmd_problems(), which reports one row per
unparseable element of a vector, with the reason for each, for checking
a column of dates before coercing itas_messydate() methods for factors (coerced via
their labels, the common case when a column was read in with
stringsAsFactors = TRUE) and a default method that names
the offending class rather than failing with R’s UseMethod
message"July 4 1976" previously
lost its day whenever another value shared the vector with it[] sets (“one member of”) silently rewrote as
{} sets (“all members of”).
[] its own meaning in the resolution functions remains
outstandingN BCE maps to the astronomical year
-(N-1), so "44 BC" becomes -0043
and "1 BC" becomes 0000 (year zero); a signed
ISO year such as "-0044" is already astronomical and is
left unchanged0000 was
misread as an unspecified year) and is traversed by seq()
and expand(), so a sequence spanning the BCE/CE boundary
now passes through the whole of year 0000 rather than
jumping from -0001 straight to 0001mdate, which records the era in the sign of the year
alone). So an input marker written once at the end of a range or set
applies to every bound of it: "..200 BC",
"200..100 BC" and "44, 33 BC" now give
..-199, -0199..-0099 and
{-0043,-0032}, where previously the non-leading bounds
silently stayed CE; an input marker written before a date still governs
that date, so "{BC2010-10-10,BC2010-10-11}" gives
{-2009-10-10,-2009-10-11}; and
"200 BC..100 AD" spans the two eras, giving
-0199..0100"circa 200 BC" is now
~-199 rather than 0200~expand() handles unspecified years
"192X" raised
'from' must be a finite number and "18XX"
silently returned a single date, even though these are what the prose
parser produces for decades and centuries"192X" gives every day of the 1920s)"192X-05-04" gives ten dates, not nine
years of them)-1999
being earlier than -1900"XXXX",
refused with a message suggesting
vmin()/vmax()expand() applies unspecified-component rules
to each member of a set separately, fixing over-expansion of sets whose
members had an unspecified month: "{2008-XX-31,2009-XX-31}"
gave 671 dates and now gives 24contract() returning every set in {}
notation, so that a [] set no longer became a
{} set on a round-trip through
expand()/contract() (closes #99)
contract() is given an
mdate, since a list of dates does not record which kind of
set its members came from?resolve_tendency now distinguishes a central tendency
that describes where several recorded occurrences sit ({})
from one that is a point estimate of a single unknown date
([]), as for a range?operate_set and ?operate_proportional now
note that a result for a [] set reads as the candidates
that remain possible, or the probability that a comparison holds, rather
than a share of recorded occurrences{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() functionThese binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.