- A test that was failing due to an incorrect assumption that the first day of the year would always fall on the first week of the year was fixed (see #35 for details). (#36, @zkamvar).
- Continuous integration has been migrated from Travis-CI + AppVeyor to GitHub actions.
as.POSIXlt()
now converts NULL to an empty POSIXlt object, so a test that was previously checking for an error failed. That test has been fixed (#33, @zkamvar)
change_week_start()
allows the user to change theweek_start
attribute of an aweek object, adjusting the weeks to match the new attribute accordingly.get_aweek()
can generate aweek objects from a vector of week numbers. It has the ability to take into account different week start times.get_date()
is similar toget_aweek()
, but returns dates instead.as.aweek()
allows users to create aweek object directly from characters with validation. It also allows for dates by passing todate2week()
.as.data.frame.aweek()
is a new function that allows aweek objects to be directly incorporated into data frames.as.list.aweek()
will now preserve the aweek structure in liststrunc.aweek()
will truncate the day to the first day of the week.rep.aweek()
allows repeating aweek characters.factor_aweek()
allows the user to create aggregated aweek objects on the fly.
There are a couple of breaking changes coming to aweek that will improve stability by removing unclear coercion methods (see #20).
- It is no longer possible to combine aweek objects if they do not share the
same
week_start
attribute. This will result in an error informing the user to adjust theweek_start
attribute with thechange_week_start()
function. - Factors will no longer coerce factors when combining aweek objects.
- Using
date2week()
withfactor = TRUE
andfloor_day = FALSE
now throws an error instead of a warning (as prophesized in #13).
- The vignette has been updated to include an explanation of the underlying week calculation from date.
- The aweek class documentation has been updated to detail the different elements of the object and the calculations.
- Package documentation
package?aweek
has been added for an introduction.
- conversions will now retain the names of the object.
- More checks that weekdays and weeks are within the correct bounds have been added.
- as.Date.aweek has been simplified to no longer rely on regex since the aweek class is standard.
- The internal
get_wday()
has been vastly simplified with improved speed.
- The
week_start
argument now defaults to the global optionaweek.week_start
, which will be a number from 1 to 7, representing the days of the week in the ISO 8601 standard. set_week_start()
is a convenience allowing the user to set the defaultaweek.week_start
option via integer or character input.get_week_start()
is a wrapper forgetOption("aweek.week_start", 1L)
andattr(w, "week_start")
for aweek objects.
- Simplified conversion to factors.
- Using
factor = TRUE
withoutfloor_day = TRUE
will now issue a message indicating that this is deprecated in future versions of aweek (see #13).
-
Fix bug where NAs threw errors in the dates (found: @aspina7, #12)
-
as.data.frame.aweek()
will now convert aweek objects to columns of data frames without losing class or attributes -
The introduction vignette has been updated to reflect this change.
- Subsetting and concatenating methods added to the
aweek
class (see #1) - Documentation divided into smaller chunks
as.POSIXlt()
bug wheretz
was not being passed was fixed.date2week()
: an error is now issued if users specify non-ISO 8601 dates OR don't specify aformat
option. (found: @scottyaz, #2)- Best practices added to vignette
- Fix test that would fail every seven days on CRAN
- First official release of aweek on CRAN
date2week()
andweek2date()
can now take days represented as characters in the current or English locale.
date2week()
gains afactor
argument, which will automatically compute the levels within the date range.
date2week()
now properly accounts for dates in December that occur in the first week of the next year.
floor_day
now truncates the week instead changing the last digit to 1 for aesthetics. (Thanks to @aspina7 for the suggestion) qprint.aweek()
now displays the day of the week in the current locale.
- First version of package
date2week()
converts dates toaweek
objectsweek2date()
convertsaweek
objects or character strings to datesas.Date()
does the same thing as aboveas.POSIXlt()
as wellas.character()
will unclass theaweek
object- Added a
NEWS.md
file to track changes to the package.