library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✔ ggplot2 3.3.6     ✔ purrr   0.3.4
## ✔ tibble  3.1.7     ✔ dplyr   1.0.9
## ✔ tidyr   1.2.0     ✔ stringr 1.4.0
## ✔ readr   2.1.2     ✔ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()

Introduction

<You will write your summary in this part of the file, you should say what your objective is and clearly state any assumptions>

<If you have particular finding, not applicable here, you should present a summary of them in your introduction>

<Depending on the project you may need to include an Executive Summary, more on that later.>

The purpose of this notebook is to <explain how to format and turn in an assignment. This example assumes you have been asked to do a set of problems,we will us R4DS “R for Data Science](”https://r4ds.had.co.nz/index.html“)

<As you review this notebook, knit it and notice how the different typographical effects relate to the notebook file.>

To turn in your work, you will create an RPubs file and send me the link. We’ll talk about that at the end of this presentation.”>

<Text contained between <> are instructions from me and would not be required in your submission.> ## Doing an Exercise from a Book

<First restate the exercise, including a code block if one is part of the statement>

Exercise 3.3.1

  1. Whats gone wrong with this code? Why are the points not blue?1
ggplot(data = mpg) +
  geom_point(mapping=aes(x = displ,y = hwy, color = "blue"))

#### Answer The color keyword is in the aes function and color is not a variable in mpg. To fix it we must move the color assignmet out of the argument of aes but keep it in the argument of geom_point.

ggplot(data = mpg) +
  geom_point(mapping=aes(x = displ,y = hwy), color = "blue")

Exercise 3.3.1

2$. Which variables in mpg are categorical? Which variables are continuous? (Hint: type ?mpg to read the documentation for the dataset). How can you see this information when you run mpg? 2

Answer:

variable name Cat or Con
manufacturer categorical
model character variable
displ continuous

  1. R4DS↩︎

  2. R4DS↩︎