The tidyr  package

The last package that deserves mention here is tidyr. The package provides a few helpful functions to convert wide tables into long and vice versa. Consequently, it can be used effectively for creating long tables and pivoting values based on column data.

The gather function allows the creation of key-value pairs by flattening the columns into a key column with the corresponding measurements in a value column.

Note that columns can be prevented from being flattened by simply passing a—sign before the name of the column

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.134.130