Crosstab
sector 2016 2017 2018 2019
Commercial Electricity 325.48 278.88 252.67 226.23
Domestic Electricity 230.75 204.08 183.57 164.24
Industry Electricity 116.00 111.22 107.68 80.62
Public Sector Electricity 86.86 71.24 68.77 61.36
Tidy
sector year territorial_emissions
Commercial Electricity 2016 325.48
Domestic Electricity 2016 230.75
Industry Electricity 2016 116.00
Public Sector Electricity 2016 86.86
Commercial Electricity 2017 278.88
Domestic Electricity 2017 204.08
Industry Electricity 2017 111.22
Public Sector Electricity 2017 71.24
Commercial Electricity 2018 252.67
Domestic Electricity 2018 183.57
Industry Electricity 2018 107.68
Public Sector Electricity 2018 68.77
Commercial Electricity 2019 226.23
Domestic Electricity 2019 164.24
Industry Electricity 2019 80.62
Public Sector Electricity 2019 61.36
Crosstab sector 2016 2017 2018 2019 Commercial Electricity 325.48 278.88 252.67 226.23 Domestic Electricity 230.75 204.08 183.57 164.24 Industry Electricity 116.00 111.22 107.68 80.62 Public Sector Electricity 86.86 71.24 68.77 61.36 Tidy sector year territorial_emissions Commercial Electricity 2016 325.48 Domestic Electricity 2016 230.75 Industry Electricity 2016 116.00 Public Sector Electricity 2016 86.86 Commercial Electricity 2017 278.88 Domestic Electricity 2017 204.08 Industry Electricity 2017 111.22 Public Sector Electricity 2017 71.24 Commercial Electricity 2018 252.67 Domestic Electricity 2018 183.57 Industry Electricity 2018 107.68 Public Sector Electricity 2018 68.77 Commercial Electricity 2019 226.23 Domestic Electricity 2019 164.24 Industry Electricity 2019 80.62 Public Sector Electricity 2019 61.36 The useR! audience will be familiar with tidy data, the way we melt or unpivot cross-tabulations into long tables of observations to better work with the data. Instead of communicating dimensions with the structure and layout of the table, we turn them into data - columns in a data frame that may be addressed and manipulated.