#Sample Solution
---
title: "Intro To GGPlot2"
output: html_notebook
---
```{r message=FALSE, warning=FALSE}
# load libraries and data
library(readr)
library(dplyr)
library(ggplot2)
```
```{r}
# Inspect the mpg builtin dataset
head(mpg)
```
```{r message=FALSE}
#Create a bar chart
bar <- ggplot(mpg, aes(class)) + geom_bar(aes(fill=class)) +
labs(title="Types of Vehicles", subtitle="From fuel economy data for popular car models (1999-2008)")
bar
```
No comments:
Post a Comment