# A tibble: 6 × 15
ID Name Sex Age Height Weight Team NOC Games Year Season City
<chr> <chr> <fct> <int> <dbl> <dbl> <chr> <chr> <chr> <int> <fct> <chr>
1 1 A Dijiang M 24 180 80 China CHN 1992… 1992 Summer Barc…
2 2 A Lamusi M 23 170 60 China CHN 2012… 2012 Summer Lond…
3 3 Gunnar N… M 24 NA NA Denm… DEN 1920… 1920 Summer Antw…
4 4 Edgar Li… M 34 NA NA Denm… DEN 1900… 1900 Summer Paris
5 5 Christin… F 21 185 82 Neth… NED 1988… 1988 Winter Calg…
6 5 Christin… F 21 185 82 Neth… NED 1988… 1988 Winter Calg…
# … with 3 more variables: Sport <chr>, Event <chr>, Medal <fct>
art <- data %>%filter(Sport =="Art Competitions") %>%select(Name, Sex, Age, Team, NOC, Year, City, Event, Medal)head(art)
# A tibble: 6 × 9
Name Sex Age Team NOC Year City Event Medal
<chr> <fct> <int> <chr> <chr> <int> <chr> <chr> <fct>
1 Win Valdemar Aaltonen M 54 Finland FIN 1948 London Art C… <NA>
2 Adolf Gaston Abel M 45 Germany GER 1928 Amsterdam Art C… <NA>
3 Adolf Gaston Abel M 45 Germany GER 1928 Amsterdam Art C… <NA>
4 Georges Achille-Fould F 55 France FRA 1924 Paris Art C… <NA>
5 Dsir Antoine Acket M 27 Belgium BEL 1932 Los Angeles Art C… <NA>
6 Dsir Antoine Acket M 27 Belgium BEL 1932 Los Angeles Art C… <NA>
# 基础计算count_art <- art %>%group_by(Year) %>%summarize(Events =length(unique(Event)),Nations =length(unique(Team)),Artists =length(unique(Name)) )head(count_art)