aes()

The aesthetics is defined as the visual property of an object in your plot.

The aes() function is partially responsible for what the data points look like in R.

There are three aesthetic attributes in ggplot2:

Color: this allows you to change the color of all of the points on your plot, or the color of each data group

Size: this allows you to change the size of the points on your plot by data group

Shape: this allows you to change the shape of the points on your plot by data group

Example of applying aesthetics

ggplot(data, aes(x=distance, y= dep_delay, color=carrier, size=air_time, shape = carrier)) +

geom_point()

 

citation: http://statseducation.com/Introduction-to-R/modules/graphics/aesthetics/

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top