Unit 6: High Quality Graphics in R (ggplot2)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/34

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering the components, aesthetics, geoms, scales, coordinates, faceting, and theming of the ggplot2 package in R.

35 Terms

1
New cards

ggplot2

An R package based on the layered grammar of graphics where plots are constructed by iteratively adding layers composed of data and aesthetic mappings.

2
New cards

Three Key Components of a ggplot

The foundational elements present in every plot: tidy data (observations in rows, variables in columns), aesthetic mappings via aes(), and at least one layer typically generated by a geom_*() function.

3
New cards

Aesthetic Mappings (aes())

Descriptions that specify how variables in the dataset correspond to visual properties of a graphic, such as position, color, shape, and size.

4
New cards

Layer

A visual building block in ggplot2 composed of a collection of geometric elements and statistical transformations.

5
New cards

Scales (scale_*())

Functions that map values from data space into aesthetic space, governing the presentation of aesthetic mappings including axis ranges, labels, color palettes, and legend formats.

6
New cards

Coord (coord_*())

Functions that define how data coordinates and plotted geometries are mapped onto the graphic's two-dimensional plane.

7
New cards

Faceting

A technique that partitions data into subsets based on categorical variables and renders each subset in a distinct subplot within a matrix or grid of small multiples.

8
New cards

Theme (theme())

The master control function for non-data visual elements of a graphic, adjusting components such as backgrounds, grid lines, text labels, fonts, and legend positioning.

9
New cards

Rendering

The visual output generation stage analogous to cooking a meal from a written recipe, where the stored plot object is drawn or printed to the screen.

10
New cards

alpha

An aesthetic attribute controlling point transparency, where 00 represents complete invisibility and 11 is the default fully opaque setting.

11
New cards

Fixed Aesthetic Attribute

A visual parameter passed directly inside a geom_*() function outside of aes(), applying a constant appearance setting rather than scaling to a variable.

12
New cards

scale_color_brewer()

A scale function linked to the ColorBrewer cartography system designed to apply specialized, professional palettes to point and line colors.

13
New cards

scale_fill_brewer()

A scale function that applies ColorBrewer color palettes to the interior fill of geoms such as bars, boxplots, histograms, and shaded areas.

14
New cards

Qualitative Palettes (ColorBrewer)

Palettes such as Set1, Dark2, and Paired designed for nominal categorical variables that lack intrinsic order.

15
New cards

Sequential Palettes (ColorBrewer)

Palettes such as Blues, YlGnBu, and Reds designed for ordered categories or continuous ranges mapped to factors.

16
New cards

Diverging Palettes (ColorBrewer)

Palettes such as RdBu, Spectral, and PiYG designed to emphasize deviations above and below a central zero or mean value.

17
New cards

facet_wrap()

A faceting function that arranges a 11-dimensional sequence of subplots across a 22-dimensional grid from left to right and top to bottom.

18
New cards

facet_grid()

A faceting function that arranges subplots along explicit row and column categorical variables to examine the interaction between two factors.

19
New cards

scales = "free"

A faceting parameter that releases the constraint of identical axis limits, allowing each subplot panel to find its own optimal axis boundaries.

20
New cards

geom_smooth()

A geom layer function that fits a statistical trendline smoother to the data and plots the smooth curve alongside its standard error.

21
New cards

LOESS (Locally Estimated Scatterplot Smoothing)

A flexible, non-parametric smoothing method used by default in geom_smooth() for datasets with n<1000n < 1000 to produce a curve following local variations.

22
New cards

span (LOESS)

A tuning parameter between 00 and 11 specifying the proportion of total data points utilized to compute each local fit.

23
New cards

GAM (Generalized Additive Model)

The default smoothing method used by geom_smooth() when fitting trends for large datasets with n>1000n > 1000.

24
New cards

geom_jitter()

A geom layer shortcut that adds random coordinate noise (defaulting to 40%40\% of data resolution) to disperse overlapping points and reveal dense clusters.

25
New cards

coord_cartesian()

A coordinate function that visually zooms in on a specified coordinate region after statistical computations and transformations have completed, avoiding row deletion.

26
New cards

coord_flip()

A coordinate function that interchanges the horizontal and vertical axes, often used to turn vertical bar charts into horizontal ones.

27
New cards

coord_fixed()

A coordinate function that enforces a fixed aspect ratio where kk units on the xx-axis equal 11 unit of physical length on the yy-axis.

28
New cards

coord_polar()

A coordinate function that maps Cartesian coordinates onto a circular grid, transforming geometric objects like bar charts into pie charts.

29
New cards

patchwork

An R package that combines separate ggplot objects into unified multi-panel layouts using arithmetic operators such as + for rows and / for columns.

30
New cards

ggsave()

A dedicated export function used to save plot objects to disk with user-defined file dimensions, defaulting to the last rendered plot when omitted.

31
New cards

element_text()

A theme helper function used to format typography, controlling parameters such as font size, face, color, and alignment for titles and axis labels.

32
New cards

hjust and vjust

Text-alignment parameters in theme elements where 00 is left or bottom aligned, 0.50.5 is centered or middle aligned, and 11 is right or top aligned.

33
New cards

element_line()

A theme helper function that specifies visual properties (such as color, size, and line type) for line components like axes and grid lines.

34
New cards

element_rect()

A theme helper function that specifies colors, borders, and fills for rectangular non-data areas like plot and panel backgrounds.

35
New cards

element_blank()

A theme function used to completely suppress drawing and remove targeted non-data components from a graphic.