Loops size estimates by name loop (solution)

Exercise
Output solution

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
Rows: 500 Columns: 2
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (1): species
dbl (1): lengths

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

1

[1] 24341.68 27017.90 67453.38 22114.19 53884.76 52026.34

2

# A tibble: 6 × 3
  species      lengths masses
  <chr>          <dbl>  <dbl>
1 Stegosauria     18.5 24342.
2 Ankylosauria    16.4 27018.
3 Ankylosauria    23.7 67453.
4 Sauropoda       23.9 22114.
5 Ankylosauria    21.7 53885.
6 Ankylosauria    21.4 52026.

3

# A tibble: 4 × 2
  species      avg_mass
  <chr>           <dbl>
1 Ankylosauria   46819.
2 Sauropoda      16104.
3 Stegosauria    31924.
4 Theropoda      45572.