Rows: 271116 Columns: 15
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (10): name, sex, team, noc, games, season, city, sport, event, medal
dbl (5): id, age, height, weight, year
ℹ 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.
# A tibble: 25,528 × 6
name sex age team year medalist
<chr> <chr> <dbl> <chr> <dbl> <lgl>
1 Paavo Johannes Aaltonen M 28 Finland 1948 TRUE
2 Paavo Johannes Aaltonen M 28 Finland 1948 TRUE
3 Paavo Johannes Aaltonen M 28 Finland 1948 FALSE
4 Paavo Johannes Aaltonen M 28 Finland 1948 TRUE
5 Paavo Johannes Aaltonen M 28 Finland 1948 FALSE
6 Paavo Johannes Aaltonen M 28 Finland 1948 FALSE
7 Paavo Johannes Aaltonen M 28 Finland 1948 FALSE
8 Paavo Johannes Aaltonen M 28 Finland 1948 TRUE
9 Paavo Johannes Aaltonen M 32 Finland 1952 FALSE
10 Paavo Johannes Aaltonen M 32 Finland 1952 TRUE
# ℹ 25,518 more rows
# A tibble: 2,703 × 6
name sex age team year medalist
<chr> <chr> <dbl> <chr> <dbl> <lgl>
1 Nstor Abad Sanjun M 23 Spain 2016 FALSE
2 Nstor Abad Sanjun M 23 Spain 2016 FALSE
3 Nstor Abad Sanjun M 23 Spain 2016 FALSE
4 Nstor Abad Sanjun M 23 Spain 2016 FALSE
5 Nstor Abad Sanjun M 23 Spain 2016 FALSE
6 Nstor Abad Sanjun M 23 Spain 2016 FALSE
7 Katja Abel F 25 Germany 2008 FALSE
8 Katja Abel F 25 Germany 2008 FALSE
9 Katja Abel F 25 Germany 2008 FALSE
10 Katja Abel F 25 Germany 2008 FALSE
# ℹ 2,693 more rows
# A tibble: 42 × 2
team total_medalists
<chr> <int>
1 Soviet Union 288
2 United States 176
3 Japan 166
4 Romania 134
5 Norway 121
6 Denmark 110
7 Hungary 110
8 China 109
9 Sweden 103
10 Italy 100
# ℹ 32 more rows
Discussion: I wanted to determine which teams had the highest number of medal-winning gymnasts. I used filter to keep the athletes who won medals. Then I used group by to group by team, using summarize function I counted the number of medalists in each team. Finally I sorted them from highest to lowest using arrange function.