/
exercise_00_answers.Rmd
54 lines (36 loc) · 1.07 KB
/
exercise_00_answers.Rmd
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
45
46
47
48
49
50
51
52
---
title: "Answers - Excercise 00"
date: "`r Sys.Date()`"
output: html_notebook
---
## exercise 00:
1. Load the tidyverse libary package
```{r}
library(tidyverse)
```
2. Fill in the blanks. Using what you've seen in class, if `data/brodheadCenter.csv` is a CSV (comma separated values) file, how would you load the file into a new object called `brodhead`?
```{r}
brodhead <- read_csv("data/brodheadCenter.csv")
```
3. Display your new `brodhead` data frame?
```{r}
brodhead
```
4. `starwars` is an on-board dataset that comes with the tidyverse. Insert a new code chunk and display that data.
```{r}
starwars
```
5. Copy and paste the following code into a new code chunk in your new file.
```{r}
starwars %>%
ggplot(aes(fct_infreq(hair_color))) +
geom_bar() +
ggtitle("Hair Color Frequency of Star Wars Characters")
```
6. Take a look at the structure of the `brodhead` object.
- How many observations (rows) are there?
- How many variables (columns) are there?
- How many of the variables are numeric data?
```{r}
glimpse(brodhead)
```