Faceting is data visualization technique, that partitions the plot into a matrix of panels. Each panel shows a different subset of the data. The subset of data is generated by dividing the main data set by some discrete or categorical variable.
There are two types of faceting:
- facet_wrap( )
- facet_grid( )
- facet_grid( ) produces 2D grid of panels, and uses all combinations between two categorical variables to create a sub-plots. Thus, if the data for some combinations is not available, it leads to empty sub-plot.
- facet_wrap( ) produces 1D chart but wraps it in 2D. Since it is essentially 1D chart, there are no empty sub-plots created using facet_wrap( ) function.
we will use gapminder data-set to create facets. We will also use some useful techniques that can be used to modify the facets in terms of Axis scales and plot layout.
the Rmarkdwon file used in this video can be found at Git repo:
github.com/sid...
4 сен 2024