tidyr 0.8.0
Breaking changes
-
There are no deliberate breaking changes in this release. However, a number
of packages are failing with errors related to numbers of elements in columns,
and row names. It is possible that these are accidental API changes or new
bugs. If you see such an error in your package, I would sincerely appreciate
a minimal reprex. -
separate()
now correctly uses -1 to refer to the far right position,
instead of -2. If you depended on this behaviour, you'll need to switch
onpackageVersion("tidyr") > "0.7.2"
New features
-
Increased test coverage from 84% to 99%.
-
uncount()
performs the inverse operation ofdplyr::count()
(#279)
Bug fixes and minor improvements
-
complete(data)
now returnsdata
rather than throwing an error (#390).
complete()
with zero-length completions returns original input (#331). -
crossing()
preservesNA
s (#364). -
expand()
with empty input gives empty data frame instead ofNULL
(#331). -
expand()
,crossing()
, andcomplete()
now complete empty factors instead
of dropping them (#270, #285) -
extract()
has a better error message ifregex
does not contain the
expected number of groups (#313). -
drop_na()
no longer drops columns (@jennybryan, #245), and works with
list-cols (#280). Equivalent ofNA
in a list column is any empty
(length 0) data structure. -
nest()
is now faster, especially when a long data frame is collapsed into
a nested data frame with few rows. -
nest()
on a zero-row data frame works as expected (#320). -
replace_na()
no longer complains if you try and replace missing values in
variables not present in the data (#356). -
replace_na()
now also works with vectors (#342, @flying-sheep), and
can replaceNULL
in list-columns. It throws a better error message if
you attempt to replace with something other than length 1. -
separate()
now longer checks that...
is empty, allowing methods to make
use of it. This check was added in tidyr 0.4.0 (2016-02-02) to deprecate
previous behaviour where...
was passed tostrsplit()
. -
separate()
andextract()
now insert columns in correct position when
drop = TRUE
(#394). -
separate()
now works correctly counts from RHS when using negative
integersep
values (@markdly, #315). -
separate()
gets improved warning message when pieces aren't as expected
(#375). -
separate_rows()
supports list columns (#321), and works with empty tibbles. -
spread()
now consistently returns 0 row outputs for 0 row inputs (#269). -
spread()
now works whenkey
column includesNA
anddrop
isFALSE
(#254). -
spread()
no longer returns tibbles with row names (#322). -
spread()
,separate()
,extract()
(#255), andgather()
(#347) now
replace existing variables rather than creating an invalid data frame with
duplicated variable names (matching the semantics of mutate). -
unite()
now works (as documented) if you don't supply any variables (#355). -
unnest()
gainspreserve
argument which allows you to preserve list
columns without unnesting them (#328). -
unnest()
can unnested list-columns contains lists of lists (#278). -
unnest(df)
now works ifdf
contains no list-cols (#344)