pmap()
now preserves names (#809)- Package developers no longer need to define
.datatable.aware = TRUE
when usingtidytable
in their package (#269)
- Attempting to rename columns using
group_by()
now leads to an error (#799) pmap()
family works with data frame inputs (#803)filter()
properly handles when comparing toNA
when.by
is used (#812)paged.print
has been removed since it was breaking console printing (#810)
distinct()
now works on data frames with list columns (#773)pivot_wider()
: Gainsunused_fn
argument (#698)
verb.()
functions have been removed
count()
has a more helpful error message whenpick()
is used (#778)unnest(keep_empty = TRUE)
preserves vectors of length 0 (#783)
distinct()
- Patch release to pass CRAN checks for future R release
reframe()
case_when()
:.default
is used when calculating a common ptype (#751)pivot_wider()
: Works correctly with dates (#759)
case_match()
: When comparing input vector to a length 1 literal
verb.()
functions are now deprecated (e.g.mutate.()
). Users should now use theverb()
versions of functions.
tribble()
nest()
: Gains.by
and.key
argstidytable()
: Auto-names unnamed inputsslice_*()
family:by
arg added to matchdplyr
semantics..by
can still be called by the user instead ofby
.dt()
: Can uselet()
to add columns even on older versions ofdata.table
expand_grid()
: Can use "unique" or "sorted" as column names (#718)
slice_head()
/_tail()
:.by
arg must be explicitly named when slicing by group
mutate()
: When overwriting existing columns on data frames with a high number of columns (>1000)
cross_join()
group_cols()
map_vec()
pick()
separate_longer_delim()
separate_wider_delim()
separate_wider_regex()
separate()
: Can now handle when too many or too few new names are specified ininto
arg (#666)unnest_longer()
: Gainskeep_empty
arg
separate()
: Can overwrite separated column without removal (#680)na_if()
: Properly replacesNA
s wheny
is a vector (#689)across()
: Anonymous functions are properly translated (#699)pivot_wider()
:names_sort = FALSE
works (#705)
- Using
by = character()
in joins is now deprecated. Users should instead usecross_join()
.
nest_join()
- Ranking functions:
min_rank()
dense_rank()
percent_rank()
cume_dist()
%in%
falls back tobase::'%in%'
when input types aren't compatible withvec_in()
(@krterberg, #632)relocate()
: Can rename columns that are moved- Joins: Can now do cross joins by specifying
by = character()
group_by()
: Gains.add
argumentungroup()
: Gains...
arguments- Printing of grouped tidytables now shows grouping variables
row_number()
: Works correctly on 0-row data frame when overwriting existing column (#639)slice_head()
/slice_tail()
: Properly slice on 0-row data frame (#642)
fill()
tidytable
now exports dotless versions of all functions (e.g.arrange()
/mutate()
/etc.).verb.()
syntax is still available to users for backwards compatibility.- Users can use both
tidytable
anddplyr
by simply loadingdplyr
aftertidytable
, as theverb.()
functions won't be overwritten bydplyr
.
- Users can use both
dplyr
-style interface to groupinggroup_by()
/ungroup()
group_vars()
is_grouped_df()
rowwise()
add_tally()
/tally()
case_match()
summarize()
: Gains.unpack
argumentpivot_longer()
: Can pass a single ptype or function tovalues_ptypes
/values_transform
/names_ptypes
/names_transform
args.unnest_longer()
/unnest_wider()
: Can pass a single ptype or function toptype
/transform
args.
tidytable::'%in%'
dispatches tobase::'%in%'
when comparing with a list (#563)pivot_wider()
: Works with column names with spaces (#569)pivot_wider()
:names_glue="{.value}_{somecolumn}"
assigns column names in correct order (@Darxor, #579)left_join()
: Works when y matching columns inby
is a non matching column of x (#625)
consecutive_id.()
if_else.()
- Note: Alternate syntax
ifelse.()
(introduced in v0.4.0) will remain in the package
- Note: Alternate syntax
%in%
arrange.()
: Can use.env
inside arrange expressionscase_when.()
: Gains.default
/.ptype
/.size
argscoalesce.()
: Gains.ptype
/.size
argsrelocate.()
: Now properly handles multiple columns selected in.before
or.after
slice_min.()
/slice_max.()
: Gainwith_ties
argument
- Nested calls to
across.()
are handled properly (#505) across.()
: Can namespace functions in.fns
arg (#511)as_tidytable()
: Can keep row names when converting a matrix (#527)unnest.()
: Handles empty data frames (@roboton, #530)nth.()
: Extracts list elements (#534)arrange.()
: Properly sortsNA
s (#541)
arrange_across.
/mutate_across.
/summarize_across.
are now defunct. They have been deprecated with warnings since v0.6.4 (Jul 2021). Users must now useacross.()
insidearrange.()
/mutate.()
/summarize.()
.
na_if.()
expand_grid.()
: Works with data frame inputsfirst.()
/last.()
/nth.()
: Gainna_rm
argmutate_rowwise.()
: Gains.keep
,.before
, and.after
argstidytable()
: Auto-unpacks unnamed data frame inputs
count.()
: Default name is nown
instead ofN
to match dplyr semantics
bind_cols.()
: Correctly handles lists (#446)
arrange.()
case_when.()
: Faster when conditions evaluate toNA
group_split.()
left_join.()
: Faster whenkeep = FALSE
(the default)select.()
uncount.()
tidytable
no longer directly depends onlifecycle
pmap.()
summarize.()
: Now sorts by the grouping variables when.by
is used.dt()
: Experimental support for tidy evaluationas_tidytable()
: Now defaults to.name_repair = "unique"
to relax restrictions on creating new tidytables
dt()
: Faster when adding new columns or updating existing columnsas_tidytable()
: Faster when convertingdata.frame
orlist
objects to a tidytableget_dummies.()
across.()
:.cols
arg can find environment variables in custom functions (#389)- Joins: Duplicate columns are treated properly when
keep = FALSE
(#397) - Can use anonymous functions inside
map
functions insidemutate.()
(#402)
add_count.()
cur_column.()
cur_data.()
unite.()
: New column is always placed before the first united column in the data frame, regardless of order provided.- Can use
.data
pronoun insidedesc()
inarrange.()
(#371)
left
/right
/inner
/full
joins gainsuffix
andkeep
args (#354)rename.()
: Can now rename columns by position (#361)unite.()
: The new column is placed before united columns to match tidyr behavior
new_tidytable()
.data
and.env
pronouns now work intidytable
functionsacross.()
: Works inside of a namedmutate.()
. Useful withrowSums
/rowMeans
(#346)first.()
/last.()
: Gain adefault
argmutate.()
: Can usestringr::str_glue()
without specifying.envir
replace_na.()
: Checks thatreplace
arg only uses columns that exist in the data frame
nth.()
mutate.()
: Can assign to the same column when.by = character(0)
(#332)
between()
is now auto-translated tobetween.()
when used insidetidytable
functions%notin%
now uses%chin%
on character vectors
across.()
: Can pass extra arguments to a list of functions (#319)
fread.()
fwrite.()
- Traceback error messages no longer unnecessarily print the full data frame (#305)
unnest_longer.()
unnest_wider.()
bind_rows.()
/bind_cols.()
- Can splice lists of data frames using
!!!
- Can splice lists of data frames using
mutate.()
: Can useglue::glue()
without specifying.envir
pull.()
: Added aname
argumentseparate.()
: Can omit output columns by usingNA
ininto
tidytable()
: Can splice quosuresunnest.()
: Addedkeep_empty
arg
- The following functions have all been deprecated due to the addition of
across.()
in v0.6.1arrange_across.()
mutate_across.()
summarize_across.()
enframe.()
first.()
last.()
- Subclasses and attributes are now preserved when using
bind_cols
,bind_rows
,group_split
, or joins. complete.()
: Added a.by
argumentexpand.()
: Added a.by
argumentmutate.()
: Auto-names unnamed inputstransmute.()
: Auto-names unnamed inputs
expand.()
withnesting.()
- Additional double vectors can have negative values (#282)
cur_group_id.()
/cur_group_rows.()
n_distinct.()
nesting.()
mutate.()
:- Added
.keep
argument - Added
.before
/.after
arguments
- Added
tidytable()
: Added.name_repair
argument
filter.()
when.by
is used
across.()
coalesce.()
group_split.()
: Added a.named
argument. If.named = TRUE
, the resulting list will have names that indicate the group they are a part of.pivot_longer.()
: Can now usenames_to = c(".value", NA)
to drop the id column.
if_all.()
/if_any.()
- No longer try to use
.by
columns (#225) - Can use
n()
in filtering (#226)
- No longer try to use
pivot_longer.()
- No longer converts factor values to character (#202, #234)
- Preserves column order when using
names_to = c(".value", "id")
(#235)
if_all.()
/if_any.()
replace_na.()
: Can now replaceNULL
values in list-columns- Splicing lists using
!!!
now works incrossing.()
andexpand_grid.()
- The following tidyverse functions are now automatically converted to their tidytable
verb.()
equivalents when used inside of tidytable's mutate/arrange/filter/summarize/slice.- Functions that previously failed but now work:
n()
row_number()
- Functions that previously worked with tidytable but are now converted to their faster tidytable equivalents:
if_else()
/ifelse()
case_when()
desc()
replace_na()
- Functions that previously failed but now work:
pivot_longer.()
: Correctly pivots unbalanced datasets when".value"
is used innames_to
(@moutikabdessabour, #212)
mutate_across.()
mutate_rowwise.()
whenc_across.()
is usedslice.()
/slice_head.()
/slice_tail.()
/slice_min.()
/slice_max.()
tidytable
has dropped thetibble
package as a dependency and now usespillar
instead.tibble
was originally used for itstrunc_mat()
function that enabled tidytables to print like tibbles do in console.pillar
is the same package thattibble
uses in the background.
between.()
as_tidytable()
: Gains.name_repair
and.keep_rownames
argscount.()
: Addedwt
,sort
andname
args. (@moutikabdessabour, #196)mutate.()
: Variables are now updated in order when using ".by" (#166)pivot_longer.()
- Added
names_prefix
arg - Can now use
".value"
innames_to
- Added
pivot_wider.()
: Can now use".value"
innames_glue
separate.()
: Addedconvert
argsummarize.()
: Variables are now created in order (#188)
pivot_longer.()
:values_drop_na
is no longer the 5th argument in the functionpivot_wider.()
:values_fn
&values_fill
args are no longer the 6th & 7th args
c_across.()
extract.()
mutate_rowwise.()
nest.()
slice_sample.()
pivot_longer.()
- New args:
names_sep
,names_pattern
,names_ptypes
,names_transform
,names_repair
,values_ptypes
,values_transform
,fast_pivot
fast_pivot
arg: Faster pivoting. The "names" column will be a factor instead of character. Default is set toFALSE
to match tidyverse semantics. Note: This option setsvariable.factor = TRUE
indata.table::melt()
, which is what leads to it being faster.
- New args:
pivot_wider.()
- New args:
names_prefix
,names_glue
,names_sort
,names_repair
- New args:
- The
dt_verb()
versions of functions have been removed from the package. They have been deprecated with warnings since v0.5.2
crossing.()
: Now works with data frame inputs (@moutikabdessabour, #143)distinct.()
: Can rename columns (#153)get_dummies.()
: Dummy columns are now sorted in alphabetical orderpivot_wider.()
: Addedvalues_fill
argument
get_dummies.()
fill.()
slice.()
mutate.()
: Can delete a column usingNULL
when.by
is provided (#151)mutate_across.()
: Can reference other columns in .fns call (#145)slice.()
: Works when.by
contains all columns (#158)unnest.()
: Works when the only column is the list column (#144)
bind_cols.()
: Name repair usesvec_as_names()
instead ofvec_as_names_legacy()
bind_cols.()
: Added.name_repair
argunnest.()
: Addednames_sep
andnames_repair
argsprint()
- Added
n
,width
, andn_extra
args - Now prints like tibbles in all cases (special thanks to @moutikabdessabour)
- Added
slice.()
: Can now drop specified rows with negative numbers
arrange_across.()
case_when.()
- The old "case when" translation
case.()
will remain in the package, as it is called likedata.table::fcase()
but allows for thedefault
to be a vector.
- The old "case when" translation
desc.()
slice.()
unnest.()
:.keep_all
arg changed to.drop
bind_rows.()
: Removed.use_names
and.fill
args- These are now assumed to be
TRUE
, which matchesdplyr
semantics.
- These are now assumed to be
complete.()
:.fill
arg renamed tofill
pull.()
: defaults tovar = -1
instead ofvar = NULL
- The result is the same when using the default value,
but will break cases where
var = NULL
was explicitly called.
- The result is the same when using the default value,
but will break cases where
slice.()
:.by
must be named when slicing by group
tidytable
now integrates better with tidyverse functions throughvctrs
. This means code such asvec_cbind(tibble::tibble(x = 1:3), tidytable(y = "foo"))
will bind the results into a tidytable.complete.()
: Can now append extra valuespull.()
: Numerical selection now worksslice.()
: Now uses...
to select which rows to slice
semi_join.()
rename.()
: Works when there are spaces in the column names (#109)
replace_na.()
- Column names auto-generated by
summarize_across.()
now use a suffix instead of a prefix
mutate_across.()
: Added.names
arg to help with naming newly created columnssummarize_across.()
: Added.names
arg to help with naming newly created columnssummarize.()
: Added.sort
arg to optionally sort the resulting data.table
transmute.()
: Doesn't drop "by" columns (#98)slice.()
- Allows gaps in
rows
arg (#99) - Doesn't reorder columns when using
.by
(#101)
- Allows gaps in
full_join.()
: No longer returns a keyed data.table (#102)
- Import
tibble
- Enables cleaner console printing of tidytables
glimpse()
is now reexported- Will be replaced by
pillar
in a later release oncetibble::trunc_mat()
&tibble::glimpse()
are moved there
bind_rows.()
use.names
arg renamed to.use_names
fill
arg renamed to.fill
complete.()
crossing.()
expand.()
expand_grid.()
uncount.()
replace_na.()
: Now works ondata.frame
/data.table
inputs as well as vectors
desc.()
has been deprecated due to incompatibility with character columns
- This version contains general performance improvements
- Group by arg
by
has been deprecated for.by
. This will allow "by" to be used as a column name inmutate.()
&summarize.()
in future releases. - All
dt_verb()
functions are soft deprecated
separate_rows.()
unnest.()
: Added.keep_all
arg to keep all list columns that were not unnested
summarize_across.()
&summarise_across.()
- Fixed
distinct.()
bug where it wasn't returning unique rows
tidytable
now works with quosurestidyselect v0.1.1
compatibility: Updated functions to usewhere()
nest_by.()
: Added.keep
arg
- Old select helpers like
everything.()
are now replaced by normal helpers likeeverything()
rename_across/_if/_at/_all
have been superseded byrename_with.()
group_split.()
:keep
arg renamed to.keep
lags.()
&leads.()
case.()
tidytable
now utilizestidyselect
&vctrs
get_dummies.()
:cols
arg defaults toc(is.character, is.factor)
. The result is the same, but is more consistent with other enhanced selection functionsmutate_across.()
:.funs
argument renamed to.fns
to match dplyr 1.0
desc.()
unite.()
- Paged printing now works in Rmarkdown
bind_rows.()
: Does name checking and fills missingdistinct.()
: Added.keep_all
argumentfill.()
: Preserves column order when using "by"group_split.()
: Addedkeep
argnest_by.()
- Can now unnest multiple columns in one call
- data.tables in a list column can now have different ncols and different column order
select.()
: Now allows column renamingtransmute.()
: Summary functions (mean
/max
/etc.) can now be used
distinct.()
drop_na.()
relocate.()
group_split.()
: Now returns a list of tidytables instead of data.tablesleft_join.()
: Now works with "by" columns of different names
- All functions are now written as
verb.()
dt_verb()
functions still work, but may be slowly deprecated in future releases
- Enhanced selection now works in "by" calls
filter.()
now works with "by"pivot_wider.()
can now be used with an aggregation functionpull.()
defaults to last column in a data.table
ifelse.()
n.()
nest_by.()
replacesdt_group_nest()
row_number.()
transmute.()
unnest.()
replacesdt_unnest_legacy()
- Select helper
any_of.()
fill.()
pivot_longer.()
unnest.()
- New
tidytable
class is a data.table subclass with cleaner printing. - Operates like a data.table in all other cases.
- All tidytable functions automatically convert to
tidytable
class in the background.
- tidytable constructors:
tidytable()
: Create a data.table/tidytableas_tidytable()
: Convert to data.table/tidytableis_tidytable()
: Test if an object is a data.table/tidytable
dt_get_dummies()
: Get dummy variablesdt_separate()
dt_pivot_longer()
"cols" arg now defaults todt_everything()
instead ofNULL
. The result is the same, but is more consistent with other enhanced selection functions.N
now works when usingdt_slice()
& variants- Function length limit bug no longer occurs when using
~
indt_map()
- Updated
dt()
docs per CRAN instructions
dt_mutate()
&dt_rename()
no longer modify-by-referencedt_unnest_legacy()
drops "keep" argument, but automatically keeps all non-nested columns.- New translation is ~5-10x faster than before
dt()
now automatically converts data.frame input to a data.tabledt_mutate_across()
: Added "by" arg
dt_left_join()
fix so columns are ordered correctly
- Initial release