May 2019
Beginner to intermediate
266 pages
5h 57m
English
There are times when our data is considered raw and unstacked (not in chronological order) and a common attribute of concern is used across the columns. To reformat the data so that these common attributes take up a single variable, the gather () function will take multiple columns and break them into key-value pairs, duplicating all other columns if needed.
The following illustration will help us to better understand the implementation of gather() function. The syntax for implementing the gather() function is as follows:
gather(data, key, value, ..., na.rm = FALSE, convert = FALSE)
Here, the parameters of the function are as follows:
Read now
Unlock full access