Wide and narrow (sometimes un-stacked and stacked, or wide and tall) are terms used to describe two different presentations for tabular data.
[Chantala, K. (2006]
"Using STATA to Analyze data from a Sample Survey"
1-10-2001. UNC Chapel Hill, Carolina Population Center. 10-1-2006.
Wide
Wide, or unstacked data is presented with each different data variable in a separate column.
Narrow
:
Narrow, stacked, or long data is presented with one column containing all the values and another column listing the context of the value
This is often easier to implement; addition of a new field does not require any changes to the structure of the table, however it can be harder for people to understand.
Implementations
Many statistical and data processing systems have functions to convert between these two presentations, for instance the
R programming language
R is a programming language for statistical computing and graphics supported by the R Core Team and the R Foundation for Statistical Computing. Created by statisticians Ross Ihaka and Robert Gentleman, R is used among data miners, bioinform ...
has several packages such as th
tidyrpackage. The pandas package in Python implements this operation a
function which converts a wide table to a narrow one. The process of converting a narrow table to wide table is generally referred to as "pivoting" in the context of data transformations. The "pandas" python package provides
method which provides for a narrow to wide transformation.
See also
*
Abstract data type
In computer science, an abstract data type (ADT) is a mathematical model for data types. An abstract data type is defined by its behavior (Semantics (computer science), semantics) from the point of view of a ''User (computing), user'', of the dat ...
*
Pivot table
A pivot table is a table of grouped values that aggregates the individual items of a more extensive table (such as from a database, spreadsheet, or business intelligence program) within one or more discrete categories. This summary might include ...
*
Table (information)
A table is an arrangement of information or data, typically in rows and columns, or possibly in a more complex structure. Tables are widely used in communication, research, and data analysis. Tables appear in print media, handwritten notes, comp ...
*
Information graphics
Infographics (a clipped compound of "information" and " graphics") are graphic visual representations of information, data, or knowledge intended to present information quickly and clearly.Doug Newsom and Jim Haynes (2004). ''Public Relations Wr ...
*
Row (database)
In the context of a relational database, a row—also called a tuple—represents a single, implicitly structured data item in a table. In simple terms, a database table can be thought of as consisting of ''rows'' and columns.Table (database)
A table is a collection of related data held in a table format within a database. It consists of columns and rows.
In relational databases, and flat file databases, a ''table'' is a set of data elements (values) using a model of vertical column ...
*
Table (HTML)
An HTML element is a type of HTML (HyperText Markup Language) document component, one of several types of HTML nodes (there are also text nodes, comment nodes and others). The first used version of HTML was written by Tim Berners-Lee in 1993 ...
References
External links
https://tidyr.tidyverse.org/articles/pivot.htmlhttps://cran.r-project.org/web/packages/reshape
{{Statistics
Statistical data types
Descriptive statistics
Data modeling