NEWS
mondate 0.11.01.01
New features
- A seqmondate generic. It works as seq.mondate for mondates.
It operates directly on Date and POSIXt objects for by
given in units based on "months".
- A cutmondate generic. It works as cut.mondate for mondates.
It operates directly on Date and POSIXt objects for breaks
given in units based on "months".
Changes
- cut.mondate
include.lowest defaults to FALSE
Bug Fixes
- Conversions from POSIXt to Date and mondate
should be equivalent, but were not when mondate ignored the fact
that the time in the POSIXt timezone could be on a different
date than the time in the user's timezone. R's internal
conversion from POSIXt to Date objects adjusted for such
differences. mondate now does as well, by coercing POSIXt
to Date, and then to mondate.
mondate 0.10.01.02 (2013-07-21)
Changes
- A new cut.mondate method
- Fashioned after a combination of cut.default and cut.Date
- Adheres to the "end-of-business-day" spirit of "mondate", but
can be overridden with "right = FALSE"
- A-la cut.default, cut intervals are represented by
as left-open / right-closed
* include-lowest = TRUE by default. This ensures that the
minimum value of the mondate is included in the first
level. The first interval, therefore, is also left-closed.
This is probably an issue only when breaks is a scalar.
- A-la cut.Date, allows the capability of an integer step when
breaks is "days", "weeks", "months", "quarters", or "years".
- Result has an optional "breaks" attribute = a mondate whose
pairwise values determine a covering of the vector
being cut. Most helpful when breaks =
"days", "weeks", "months", "quarters", or "years".
Such "breaks" are suitable be use by 'hist'.
Attribute is attached to the result by setting argument
attr.breaks = TRUE (FALSE by default).
- New 'as.difftime' function to enable units 'months' and 'years'
- Now the difference between two mondate objects will be a
difftime object with units = timeunits of the first
mondate
- New + and - methods for mondate,difftime signatures to simplify
adding and subtracting when the desired units (e.g.,"days")
is not "months" or "years".
- Example: mondate("2013-01-01")+difftime(1, units = "days")
- New 'add' and 'subtract' functions to return a date on the
same day of the month (subject to restrictions on the number
of days in a month), purposely violating the mondate
paradigm of measuring time in fractions of a month.
Furthermore, the argument 'forcelastday' (default = FALSE)
will guarantee that the result will be on the last day
of the month if the input 'mondate' value is.
- Examples:
* add(mondate.ymd(2013, 1:12, 15), 1) will always
result in a date on the 15th of the month.
* add(mondate.ymd(2013, 1:12, 15), 1, "days") yields
mondates corresponding to the 16th of each month.
- A new "formatFUN" slot of the 'mondate' class
- The purpose of this slot is to allow for the user to define
a special formatting function for converting mondate's to
character. For example, there is no format string that
will format dates in terms of calendar quarter, but this
can now be accomplished by specifying 'formatFUN' when
the mondate is created.
- A function that will represent mondate's in YYYYQ* format,
for * = 1-4, is exported in mondate's namespace under the
name 'YearQuartersFormat'.
- The default value of formatFUN is NULL, in which case
mondate uses the previous behavior -- i.e., formatting
as a date according to the displayFormat of the mondate.
- A new "quarters" S3 method
- Returns the "Q1 - Q3" representation of the calendar quarter
of the mondate. Same behavior as the quarters.Date method.
- A new "quarter" S4 generic with methods for mondate, Date, POSIXt
- Returns the numeric value of the calendar quarter.
Bug Fixes
- The default values for displayFormat (especially) and timeunits
were not being set correctly on package load. As a result,
the default displayFormat was always the international date standard
even when the user's locale was in the United States.
These values are now being determined at the time
a mondate instance is created.
mondate 0.9.10.04 (2013-02-10)
Changes
- year(), month(), day() functions have methods for Date and POSIXt objects.
- New "factor" signature for 'mondate' method converts factor to character
then applies the "character" signature method.
- ymd() function retains names of argument if available
mondate 0.9.10.01 (2012-09-09)
Changes
- Replaced S4 methods cbind and rbind with functions cbindmondate and rbindmondate. This removed the two Internal calls in the package. As a result, the functionality is slightly changed:
- Whereas mondate's and non-mondate's could previously be c/r-binded together with the result being a mondate, such a "mixed combination" now results in a data.frame. If necessary, non-mondates should be coerced to mondates ahead of time.
- When all the arguments are mondates, the result is a mondate as before.
- The user will no longer see the message about the c/r-bind generics being created when the package is loaded.
- Base c/r-bind with mondate arguments act on the Data slot of the mondates.
- The as.numeric method now assignes the names attribute of the mondate, if it exists. Before, only the dimnames attribute was assigned.
mondate 0.9.9.01 (2012-02-12)
Bug Fixes
NEW FEATURES
- New 'as.mondate' function for coercing R objects to a mondate
Changes
- Reverted any S4 method better implemented as S3 to an S3 version.
In particular, 'format' and 'unique' enable 'aggregate' to work
with a mondate object specified in 'by' argument
- Removed deprecated 'displayFormat' argument from as.character.mondate method
- Clarified some of the documentation