There’s more!
See book chapter and especially the vignette!
- drop or add a (wide-table) column name prefix with the
names_prefixargument - drop ‘id’ columns (i.e. non-pivoted columns) in
pivot_wider()with theid_colsargument - generate rows with missing values in
pivot_wider()with theid_expandargument - aggregating values in
pivot_wider() - combining
pivot_longer()andpivot_wider()for more complex situations - for more complex cases, instead of
names_*andvalues_*arguments, you can construct a single specification dataframe that you can provide to bothpivot_longer_spec()andpivot_wider_spec() - and more