- Removed usage of the non-standard
ESTtime zone from tests.
-
Multi-week periods are no longer allowed. These previously threw a warning from lubridate and were already partially broken. Now lubridate throws an error if multi-week periods are supplied (#103).
-
Adapted to stricter parsing in lubridate and timechange (#103).
-
Fixed usage of
|rather than||in the C++ code to satisfy a CRAN warning. -
Fixed a tidyselection warning emitted by the
tbl_timemethod forunnest()(#100). -
Removed usage of deprecated
tibble::trunc_mat()in favor ofpillar::tbl_sum().
- Fixed minor tidyr 1.0.0 warnings in tests using
nest().
-
Coercing a grouped tbl_time object to tibble with
as_tibble()now drops groups and returns a bare tibble. The previous behavior of returning a grouped tibble was incorrect and let to faulty behavior in other functions. -
Fixed an issue related to
dplyr::ungroup()in dplyr 1.0.0 where ungrouping would not return an ungrouped tbl_time (#91).
- Minor release to stay compatible with tibble 3.0.0 and the upcoming release of dplyr 1.0.0.
-
Features
- Methods for
tidyr::nest()andtidyr::unnest()have been updated to be compliant with tidyr 1.0.0. An error will be triggered if you have a version of tidyr installed that is < 1.0.0 and try to use one of these functions on atbl_timeobject.
- Methods for
-
Bug fixes
collapse_by()no longer errors when there is a column namedstart_datein thetbl_timeobject (#81).
-
Features
- Export a constructor for
tbl_timeobject throughnew_tbl_time(). Only to be used by package developers extendingtibbletime.
- Export a constructor for
-
Bug fixes
-
For
tibble2.0.1, an internal bug fix was made to pass along annrowargument. -
For
dplyr0.8.0, an internal fix was made in one of the tests. -
A new line was added to
inst/include/is_ordered.hto appease CRAN. -
The tbl_time time zone for
POSIXctindices is now set as the first non NA value of: "tzone" attribute ->Sys.timezone()-> "UTC". Previously there was noSys.timezone()step as there were problems with local time zones such asAmerica/New_Yorkinteracting with collapsing by day. Those problems have been fixed by usingDSTdaywith allPOSIXctindices even ifdayis specified.
-
-
General
-
collapse_index()andcollapse_by()support acleanargument. This will round your index up/down to the next period boundary, allowing for prettier dates that can be used in summaries. -
A new helper function,
collapse_by(), wraps the common idiom of.tbl_time %>% mutate(date = collapse_index(date, "yearly"))and is the easiest way to usetibbletimewith the rest of the tidyverse. -
You can now pass an index vector (easily created with
create_series()) to theperiodargument of functions likeas_period()orcollapse_by()to specify custom periods to collapse at. -
Added support for
millisecondandmicrosecondgrouping. See?create_seriesfor examples and?filter_timeDetails for more information. -
partition_index()(and therefore higher level functions likecollapse_by()) now round using the entireperiodargument to figure out the default start date. Meaning if2 yearsis passed, it will round down the start of the series to the lower2 yearboundary, rather than justyear. This is a small change, but is technically breaking. -
More efficient parsing of periods. Only noticably faster with a large number of groups.
-
-
Bug Fixes
tidyr::gather()andtidyr::spread()now work appropriately.
This is a major update. It introduces a huge number of breaking changes as
we heavily reworked the internals of the package. This should ensure the
longevity of the package and provide maximum flexibility for its use with dplyr.
As this was still early in package development with minimal usage,
and because we had issued a Warning in
the README of the last update that we may change things, we have not made any
attempt to support backwards compatability. From this point forward, however,
we will support backwards compatability as we feel that we have reached a
more stable implementation.
With that out of the way, here is a complete list of changes.
-
General
-
The
periodargument no longer supports the 'period formula' (e.g.1~year). It added unnecessary complication with little benefit. Rather, a character should be used like'1 year'. See the documentation ofpartition_index()for full details. -
time_formulaarguments still support thefrom ~ tostyle syntax, but the left and right hand sides must now be characters, rather than bare date specifications. In English, rather than2013 ~ 2014, you must use'2013' ~ '2014'. This is easier to program with and also allows you to pass in variables to the time formula, which previously did not work well. -
time_filter()has becomefilter_time(). This naming is easier to remember now that a suite oftime_*()functions is not being developed and is easier to find with autocompletion. -
time_group()andtime_collapse()have becomepartition_index()andcollapse_index(). Both functions acceptindexvectors and are commonly used insidedplyr::mutate(). -
partition_index()splits an index by period and returns an integer vector corresponding to the groups. -
collapse_index()collapses an index by period so that all observations falling in that interval share the same date. This is most useful when used to then group on the index column. -
There is full support for
DateandPOSIXctclasses as the index, and there is experimental support foryearmon,yearqtr, andhmsclasses. -
ceiling_index()andfloor_index()are thin wrappers aroundlubridatefunctions of similar names, but they also work foryearmon,yearqtrandhms. -
create_series()now has an explicitclassargument. -
as_period()gains aninclude_endpointsargument for including the last data point ifside = "start"is specified or the first data point ifside = "end"is used. -
There are a number of new "getter" functions for accessing the index and time zone of
tbl_timeobjects. These are useful for package development. -
filter_time(),as_period()and other "getter" functions now use.tbl_timeas a consistent first argument rather thanx.collapse_index()andpartition_index()useindexas their first arguments. -
Exported
parse_period()for general use in other related packages. -
Warnings are now generated if the user is not using a sorted index.
-
-
Bug Fixes
-
All
dplyrfunctions should now retain thetbl_timeclass and relevant attributes. -
Ensure that
tidyr::spread()passes thefillargument through. -
Default time zone is now
UTCrather thanSys.timezone()to handle a daylight savings issue.
-
-
New functionality
-
time_floor()andtime_ceiling()are convenient wrappers tolubridatefunctions for altering dates to period boundaries. -
time_unnest()is used to specifically unnest atibbleobject with a list-column oftbl_timeobjects. -
create_series()allows the user to create atbl_timeobject with a regularly spaced sequence of dates. -
time_group()has become the workhorse function for creating time based groups used in changing periodicity and other grouped time based calculations. -
time_summarise()andtmap()now also accept a formula-basedperiod. -
as_period()now accepts a formula-basedperiodthat provides an incredible amount of flexibility in creating groups. (#9, #14, #15) -
rollify()creates a rolling version of any function for use indplyr::mutate(). (#7)
-
-
General
-
You now have to explicitely load
dplyrortidyrto use any functions from those packages. Previously they were reexported, but this seems unnecessary. -
Added vignettes on intro, filtering, and
as_period(). -
Added more extensive
dplyrsupport. -
Speed increases for
as_period()andcreate_series(). -
Internal global utilities moved to
utils.R. -
Added test coverage. (#2)
-
Added package documentation page. (#3)
-
Added versions to all imported packages.
-
-
Bug Fixes
-
Fixed an issue with
[in combination withtibble::add_column(). Usetibble (>= 1.3.4.9001)for correct behavior. -
Fixed a bug where using
tidyr::nest()would cause the nested tibbles to lose their time attributes. -
Fix a bug where filter_time(data, ~yyyy-mm-dd) would be parsed as
yyyy-mm-dd 00:00:00 ~ yyyy-mm-dd 00:00:00instead ofyyyy-mm-dd 00:00:00 ~ yyyy-mm-dd 23:59:59. -
Fix a bug with as.Date / as.POSIXct operator collision in
filter_time().
-
- Initial release of
tibbletime, a package for time aware tibbles.