@@ -399,9 +399,9 @@ been met:
399
399
400
400
Suppose we have observations spread across multiple rows rather than in a single \index{pivot\_ wider}
401
401
row. For example, in Figure \@ ref(fig: long-to-wide ), the table on the left is in an
402
- untidy, long format because the ` count ` column contains two variables
403
- (population and commuter count) and information about each observation
404
- (here, population and commuter counts for a region) is split across two rows.
402
+ untidy, long format because the ` count ` column contains three variables
403
+ (population, commuter, and incorporated count) and information about each observation
404
+ (here, population, commuter, and incorporated counts for a region) is split across three rows.
405
405
Remember: one of the criteria for tidy data
406
406
is that each observation must be in a single row.
407
407
@@ -413,8 +413,7 @@ before the maximum can be computed.
413
413
In comparison, if the data were tidy,
414
414
all we would have to do is compute the maximum value for the commuter column.
415
415
To reshape this untidy data set to a tidy (and in this case, wider) format,
416
- we need to create a column called "population"
417
- and a column called "commuters."
416
+ we need to create a column called "population", "commuters", and "incorporated."
418
417
This is illustrated in the right table of Figure \@ ref(fig: long-to-wide ).
419
418
420
419
``` {r long-to-wide, echo = FALSE, message = FALSE, warning = FALSE, fig.cap = "Going from long to wide data.", fig.retina = 2, out.width = "100%"}
0 commit comments