-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomework-2.Rmd
More file actions
44 lines (36 loc) · 871 Bytes
/
homework-2.Rmd
File metadata and controls
44 lines (36 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: "SDS 192: Homework #2"
author: Natalia Iannucci
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Problem 2
```{r message=FALSE}
library(tidyverse)
a_new_hope <- starwars %>%
filter(mass < 1000,
grepl("A New Hope", films))
```
```{r message=FALSE}
character_dimensions <- ggplot(a_new_hope, aes(x = mass, y = height, color = species))
character_dimensions <- character_dimensions +
geom_point() +
ylab("Height (centimeters)") +
xlab("Mass (kilograms)") +
ggtitle("Height and Mass of Characters in a New Hope (1977)") +
labs(subtitle = "Separated by Species")
character_dimensions
```
Problem 3
```{r eval=FALSE}
install.packages(ggrepel)
```
```{r message=FALSE}
library(ggrepel)
```
```{r message=FALSE}
character_dimensions +
geom_label_repel(aes(label = name, color = species))
```