-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeteorites.Rmd
54 lines (36 loc) · 1.12 KB
/
meteorites.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
53
---
title: "R Notebook"
output:
html_document:
df_print: paged
---
Read the cleaned data into R.
Find the names and years found for the 10 largest meteorites in the data.
Find the average mass of meteorites that were recorded falling, vs. those which were just found.
Find the number of meteorites in each year, for every year since 2000.
```{r}
library(tidyverse)
library(janitor)
# Read the cleaned data into R.
meteorite_landing_clean_data <- read_csv("data/meteorite_landings_clean_data.csv") %>% clean_names()
```
```{r}
# Find the names and years found for the 10 largest meteorites in the data.
meteorite_landing_clean_data %>%
select(name, year, mass_g) %>%
arrange(desc(mass_g)) %>%
head(10)
```
```{r}
# Find the average mass of meteorites that were recorded falling, vs. those which were just found.
meteorite_landing_clean_data %>%
group_by(fall) %>%
summarise(avg_mass_g = mean(mass_g))
```
```{r}
# Find the number of meteorites in each year, for every year since 2000.
meteorite_landing_clean_data %>%
filter(year >= 2000) %>%
group_by(year) %>%
summarise(number_of_meteorites = n())
```