ggplot()
Every ggplot2 graph starts with the ggplot() function. Plot variables are specified inside the aes() function.
This page uses the lfs26sep dataset from the Setup section.
ggplot()
ggplot(lfs26sep)

ggplot(lfs26sep, aes(x = hrlyearn))

ggplot(lfs26sep, aes(x = uhrsmain, y = hrlyearn))

To draw data on the canvas, add a geom function, such as geom_histogram(), using +. The next examples show how.