ggplot() in R?ggplot() creates a blank canvas for making plots. It sets up the space where you add layers like points, lines, or bars.
aes() do inside ggplot()?aes() stands for aesthetics. It tells ggplot() which data columns to use for x-axis, y-axis, colors, sizes, and other visual parts.
height to the y-axis using aes()?You write aes(y = height) inside ggplot() or a layer to tell ggplot to use the height data for the vertical axis.
aes()? Give an example.Yes! You can map many things. For example, aes(x = age, y = height, color = gender) maps age to x-axis, height to y-axis, and colors points by gender.
aes() inside ggplot() vs inside a layer like geom_point()?Inside ggplot(), aesthetics apply to all layers. Inside a layer, they apply only to that layer. This helps control what data each layer uses.
ggplot(data, aes(x = var1, y = var2)) do?This code starts a plot with var1 on the x-axis and var2 on the y-axis.
aes() sets the mapping of data to visuals like axes and colors.
group, where do you put color = group?Color mapping must be inside aes() to link it to data.
geom_point() add to a ggplot?geom_point() adds dots representing data points.
aes() if you want different layers to use different mappings?Putting aes() inside layers lets each layer have its own mapping.
ggplot() and aes() work together to create a plot.