![]() # If necessary # install.packages(c('ggplot2','cowplot')) # load packages library ( ggplot2 ) # Cowplot is just to join together the four graphs at the end library ( cowplot ) # load data (the Economics dataset comes with ggplot2) eco_df <- economics # basic plot p1 <- ggplot () + geom_line ( aes ( x = date, y = uempmed ), data = eco_df ) p1 # Change line color and chart labels # Note here that color is *outside* of the aes() argument, and so this will color the line # If color were instead *inside* aes() and set to a factor variable, ggplot would create # a different line for each value of the factor variable, colored differently. This site uses Just the Docs, a documentation theme for Jekyll.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |