R-ecology-lesson icon indicating copy to clipboard operation
R-ecology-lesson copied to clipboard

long vs wide format for ggplot

Open SichongP opened this issue 5 years ago • 2 comments

In Visualizing Data part of the lesson, it reads:

ggplot2 functions like data in the ‘long’ format, i.e., a column for every dimension, and a row for every observation.

Shouldn't it be 'wide' format? Long format is where all variables are stacked in a single column.

SichongP avatar Jul 14 '20 17:07 SichongP

ggplot2 does like data in the long format (for instance all the levels for a treatment should be in the same column) but I agree that the statement "a column for every dimension" might be misleading. Would you have a suggestion to improve the wording here?

fmichonneau avatar Jul 20 '20 08:07 fmichonneau

I've heard long format described as "every column is a variable; every row is an observation" before. Would that work? If so, I can open a PR.

kaijagahm avatar May 03 '21 12:05 kaijagahm