pivot_longer()
helps us take our data from wide to long formatnames_to =
gives a new name to the pivoted columnsvalues_to =
gives a new name to the values that used to be in those columns
pivot_wider()
helps us take our data from long to wide formatnames_from
specifies the old column name that contains the new column namesvalues_from
specifies the old column name that contains new cell values
- to merge/join data sets together need a variable in common - usually “id”