1/22
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
geom_bar()
a function in ggplot2 used to create bar charts
y-axis in geom_bar()
you should not supply a y aesthetic when you use a geom_bar(). ggplot will count how many times x value appears in the data, then display the counts on the y axis
count()
a function in ggplot2 that counts the number of occurrences of each value in a vector or variable
geom_col()
a function in ggplot2 used to create bar charts where the heights of the bars represent values in the data, rather than counts
Aesthetics
the visual properties of a plot in ggplot2, such as color, size, shape, and transparency, that can be mapped to data variables and used to enhance data visualization
color =
assigns color to the outline of a plot element
fill =
assigns color to the interior of a plot element
width =
assigns the thickness of a plot element's outline such as lines or bars
Position Adjustments
manipulates the placement of data points or bars in a plot to improve clarity and avoid overlap
fill = clarity
assigns transparency to the interior of a plot element, improving visual distinction
position = “dodge”
a position adjustment that separates overlapping bars in a bar chart to make them visually distinct
clarity(stacked)
a method that stacks plot elements while adjusting their transparency to enhance visibility and distinguish between categories
position = “stack”
a position adjustment that stacks overlapping elements on top of each other in a plot, allowing for combined visual representation of categories
position = “fill”
a position adjustment that scales overlapping elements in a bar chart to fill the same height, allowing for proportionate comparison of categories
position = “identity”
a bad position adjustment that retains the original data values of overlapping elements in a plot without stacking or scaling, allowing for a straightforward representation of each category
why is it position = “identity” bad?
it does not provide a clear visual comparison of overlapping elements, as the original data values remain unchanged and can lead to misleading interpretations
Facets
a way to create multiple subplots based on a factor or variable, allowing for comparison across different groups or categories within a single visualization
facet_grid()
a function in the ggplot2 package in R that creates a grid of plots based on two categorical variables, allowing for easy comparison of distributions and patterns across different combinations of those variables
facet_wrap()
a function in the ggplot2 package in R that creates a series of plots wrapped into a specified number of rows and columns based on a single categorical variable, making it easier to visualize multiple groups in a tidy format
scales argument
an argument used in ggplot2 functions to manage the scaling of axes, allowing for customization of the scale type, labels, and limits for better visualization
scale = “free”
allows each facet to have its own scales, enabling better visualization of varying ranges across different subplots
scales = “free_x”
allows the x-axis to vary independently for each facet, enhancing clarity when comparing different groups with unequal distributions
scales = “free_y”
allows the y-axis to vary independently for each facet, improving the visualization of varying data ranges across different subplots